I get the following error when binding the RadioButtonList to a property type of either dynamic or int? (nullable). The designer is not building the code in a way that will work. I need to be able to bind the list to a an int?.
|Error|CS1662|Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
If I manually modify the razor like the online example shows, it works. I just can't get it to work with the designer and don't want to have to exclude the page to get it to work.
The designer creates this:
<RadzenRadioButtonList @bind-Value="@answerValue" Name="Answer" Change="@AnswerChange"> <Items> <RadzenRadioButtonListItem Text="Yes" Value="0"> </RadzenRadioButtonListItem> <RadzenRadioButtonListItem Text="No" Value="1"> </RadzenRadioButtonListItem> <RadzenRadioButtonListItem Text="Not Applicable" Value="2"> </RadzenRadioButtonListItem> </Items> </RadzenRadioButtonList>
But this is what is needed to work:
<RadzenRadioButtonList @bind-Value="@answerValue" TValue="int?" Name="Answer" Change="@((args) => AnswerChange(args))"> <Items> <RadzenRadioButtonListItem Text="Yes" Value="0" TValue="int?"> </RadzenRadioButtonListItem> <RadzenRadioButtonListItem Text="No" Value="1" TValue="int?"> </RadzenRadioButtonListItem> <RadzenRadioButtonListItem Text="Not Applicable" Value="2" TValue="int?"> </RadzenRadioButtonListItem> </Items> </RadzenRadioButtonList>