My question specifically relates to the use of Radio Group, but could apply to other controls as well. Where the documentation talks about value binding vs data binding, this is in relation to the source data (i.e. the collection of options a user can choose from), and not the selected value. Taking the following example:
<TelerikRadioGroup @bind-Value=@selectedValue Data=@sourceList TextField="ATextProperty" ValueField="AnIntProperty"></TelerikRadioGroup>
In this case in my code I can have my selectedValue be an int (to match the value field). But lets say, following the example from the documentation, I want to bind the selected object, not a property of the object, like this:
<TelerikRadioGroup @bind-Value=@selectedValue Data=@sourceList TextField="GenderText" TValue="GenderModel"></TelerikRadioGroup>
Is there a way to do something like this? I haven't been able to get it work. I have tried using ValueChanged as well, this way:
<TelerikRadioGroup @selectedValue Data=@sourceList TextField="ATextProperty" ValueChanged="@((v) => OnValueChanged(v))"></TelerikRadioGroup>
And this way:
<TelerikRadioGroup @selectedValue Data=@sourceList TextField="ATextProperty" ValueChanged="@((GenderModel v) => OnValueChanged(v))"></TelerikRadioGroup>