I noticed that when a class has Json Property Attributes attached to it's properties the combobox has it's dropdown populated with the list data but there is an error in the selection? Is there a workaround for this?
@page "/counter"
<SfComboBox TValue="int" TItem="Person" DataSource="@people">
<ComboBoxFieldSettings Text="Name" Value="Id"></ComboBoxFieldSettings>
</SfComboBox>
@code{
List<Person> people;
protected override void OnInitialized()
{
base.OnInitialized();
people = new List<Person>
{
new Person
{
Id =1,
Age = 35,
Name = "Paul"
},
new Person
{
Id =2,
Age =45,
Name= "Julie"
}
};
}
public class Person
{
[Newtonsoft.Json.JsonProperty("id")]
public int Id { get; set; }
[Newtonsoft.Json.JsonProperty("age")]
public int Age { get; set; }
[Newtonsoft.Json.JsonProperty("name")]
public string Name { get; set; }
}
}