```
```
Hi Robert,Greetings from Syncfusion support.Currently the value property accepts only String, Number or Boolean value. So, we are considering this (“Bind the dropdownlist value property as object”) as a feature in our end. This support will be included in any one of our upcoming releases. You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link.Also, our AutoComplete component support, complex type. Please check the below documentation.UG Link: https://ej2.syncfusion.com/blazor/documentation/autocomplete/data-source/#array-of-complex-objectAnd you can get the object value from the change event arguments and assign it to the Value property of the AutoComplete component.Regards,Berly B.C
|
@using Syncfusion.Blazor.DropDowns
@using Newtonsoft.Json
<SfAutoComplete TValue="string" TItem="Countries" Placeholder="e.g. Australia" DataSource="@LocalData">
<AutoCompleteFieldSettings Value="Name"></AutoCompleteFieldSettings>
<AutoCompleteEvents TValue="string" ValueChange="onValueChange"></AutoCompleteEvents>
</SfAutoComplete>
@code {
public class Countries
{
public string Name { get; set; }
public string Code { get; set; }
}
List<Countries> LocalData = new List<Countries> {
new Countries() { Name = "Australia", Code = "AU" },
new Countries() { Name = "Bermuda", Code = "BM" },
new Countries() { Name = "Canada", Code = "CA" },
new Countries() { Name = "Cameroon", Code = "CM" },
new Countries() { Name = "Denmark", Code = "DK" }
};
public void onValueChange(ChangeEventArgs<string> args)
{
var item = JsonConvert.DeserializeObject<Countries>(args.ItemData.ToString());
var value = item.Name;
}
} |