开发者

WPF comboBoxEdit

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


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:

<dxe:ComboBoxEdit Height="20" Margin="14,64,0,0" Name="comboBoxEdit1" 
DisplayMember = "CategoryName" ValueMember = "UserCategoryID" VerticalAlignment="Top"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
HorizontalAlignment="Left" Width="254" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜