我在我的WPF应用程序中使用了devexpress comboBoxEdit组件。我赋值为这样的:WPF Devexpress ComboBoxEdit Items
private void Users1_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;
}
我的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" />
但问题是,在这个组合框我看到我的ID(价值委员),只有当我展开它,然后我看到DisplayMember值。什么是问题,怎么做总是看到文本值,而不是我的ID ..?
好,对于ansver和解决方案的感谢。似乎Devexpress有一些seriuos废话。 – Vytas999 2009-12-01 14:34:27