Data is not Displaying in the Combo Box
DataTable dt = new DataTable();
dt.Columns.Add("Code");
dt.Columns.Add("Name");
dt.Rows.Add("c1", "n1");
dt.Rows.Add("c2", "n2");
myCombo.ItemsSource = ((IListSource)dt).GetList();
myCombo.DisplayMemberPath = "Code";
myCombo.SelectedValuePath = "Name";
instead of this line
myCombo.ItemsSource = ((IListSource)dt).GetList();
try to use this one
myCombo.ItemsSource = dt.DefaultView;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With