views:

136

answers:

1

Hello, i Have problem with WPF comboBoxEdit. I load values it it like this:

comboBoxEdit1.ItemsSource = dtCat.DefaultView;

Values are loaded, everything works good, but when i select some value from dropdown, in combobox i see not the "DisplayMember" value, but the "ValueMember" value (some numeric ID). What i do wrong?I want to see DisplayMember value when i select some item. Thanks

A: 

Here my is load: DataTable dtCat = SqlHelper.GetTable("base_UserCategory_Select", new string[] { }); DataRow dr = dtCat.NewRow(); dr["UserCategoryID"] = 0; dr["CategoryName"] = "< All >"; dr["IsSystem"] = "False"; dtCat.Rows.InsertAt(dr, 0); comboBoxEdit1.ItemsSource = dtCat.DefaultView; comboBoxEdit1.SelectedIndex = 1; Here is my XAML:

Vytas