Hello,
I'm using Radzen Blazor components(3.18.3).
This is how DropDown is defined:
<RadzenDropDown style="width: 100%" @bind-Value="@value" TextProperty="Data" ValueProperty="Id" Data="@list">
</RadzenDropDown>
This is how Data, value and class are defined:
public class UserFieldInfo
{
public int Id { get; set; }
public string TableName { get; set; }
public string FieldGroupType { get; set; }
public string Data { get; set; }
}
UserFieldInfo value = new UserFieldInfo() { Id = 1, Data = "Test1" };
IEnumerable<UserFieldInfo> list;
list = new List<UserFieldInfo>()
{
new UserFieldInfo(){ Id = 1, Data = "Test1" },
new UserFieldInfo(){ Id = 2, Data = "Test2" },
new UserFieldInfo(){ Id = 3, Data = "Test3" },
};
My expectation is that after page is loaded the very first element of list is selected in the dropdown and "Test1" is displayed in that dropdown. Instead nothing is displayed in the dropdown and selection is somehow borked. E.g.
Am I missing or misunderstanding something? How do I bind such object and display respective TextProperty?
Thanks!