Basic property setting of TextBox Value not binding

I investigated this further.

This does not compile (Disabled and @bind-Value are set).

<RadzenDropDown Data="@myData" Disabled="@(Mode == MyEnum.Special)" TextProperty="id" @bind-Value="@myValue" ValueProperty="value" Name="Dropdown0">
</RadzenDropDown>

This compiles (@bind-Value is not set).

<RadzenDropDown Data="@myData" Disabled="@(Mode == MyEnum.Special)" TextProperty="id" @bind-Value="@myValue" ValueProperty="value" Name="Dropdown0">
</RadzenDropDown>

And so does this (Disabled is set to a constant)

<RadzenDropDown Data="@myData" Disabled="true" TextProperty="id" @bind-Value="@myValue" ValueProperty="value" Name="Dropdown0">
</RadzenDropDown>

So far setting TValue explicitly is the only way to hint the compiler what the TValue generic argument is. It seems that having Disabled set to an expression that uses a dynamic property (Mode) stops the automatic generic argument resolution for some reason.

Radzen is currently not generating TValue on purpose - it isn't always possible to determine it predictably during code generation time.

1 Like