Hi Leon,
Thank you contacting Syncfusion support.
We have analyzed your query “How to set default value for DataFormDropDownItem?”, you can set any of value from ItemsCollection in DropDown item’s underlying property to display the selected item. Editor cell value will be converted and given value will be selected from ItemsSource. If you want to use complex class for DropDown then set value of SelectedValuePath.
Code Snippet:
[C#]
private IList GetItemSource(string sourceName)
{
List<Address> details = new List<Address>();
if (sourceName == "City")
{
details.Add(new Address() { City = "Chennai", PostalCode = 1 });
details.Add(new Address() { City = "Paris", PostalCode = 2 });
details.Add(new Address() { City = "Vatican", PostalCode = 3 });
}
return details;
}
public class ContactsInfo
{
public string City { get; set; } = "1";
} |
We have prepared sample for the same,
We hope that this helps you, kindly revert us if you have any concern.
Regards,
Subburaj Pandian V