我在我的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