Hopefully you can help me with something I thought I had figured out!
I have a dropdown on an 'add device' form.
The data for the dropdown is a simple list (int ContactsId, string CombinedName).
I want to display the name in the dropdown (for the user to select), but when the form is submitted I want the associated ContactsId to be saved in the new device record.
I have my dropdown set up as follows:
<RadzenDropDown Data="@contactList" style="display: block; width: 100%"
@bind-Value="@device.ContactsId" ValueProperty="ContactsId" TextProperty="CombinedName" Name="ContactsId"/>
When I make a selection in the dropdown I get the following error:
"System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Nullable`1[System.Int32]'."
So clearly it is trying to add CombinedName (string) into @device.ContactsId (int).
I thought setting the ValueProperty to ContactsId should have handled this?
Please Help! :o)