You will need to use the ItemsSource property and we also need to
explicitly convert the DataTable into a list:
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";
Reference:
Beatriz Costa Binding to ADO.NET (
http://www.beacosta.com/blog/?cat=12)
Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.