Wpf 将数据表中的值放入DevExpress comboBoxEdit项中

Wpf 将数据表中的值放入DevExpress comboBoxEdit项中,wpf,combobox,datatable,devexpress,Wpf,Combobox,Datatable,Devexpress,有人能解释一下,如何简单地将数据表中的值放入DevExpress comboBoxEdit项中吗?在WinForms中,它是这样的: dtCat = SqlHelper.GetTable("base_UserCategory_Select", new string[] {}); DataRow dr = dtCat.NewRow(); dr["UserCategoryID"] = 0; dr["CategoryName"] = "< All >"; dr["IsSystem"] =

有人能解释一下,如何简单地将数据表中的值放入DevExpress comboBoxEdit项中吗?在WinForms中,它是这样的:

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);
comboBox1.DataSource = dtCat;
dtCat=SqlHelper.GetTable(“base_UserCategory_Select”,新字符串[]{});
DataRow dr=dtCat.NewRow();
dr[“UserCategoryID”]=0;
dr[“CategoryName”]=“”;
dr[“IsSystem”]=“False”;
dtCat.Rows.InsertAt(dr,0);
comboBox1.DataSource=dtCat;
如何像这样将值分配给DevExpress ComboBox编辑?

数据表dtCat=SqlHelper.GetTable(“base\u UserCategory\u Select”,新字符串[]{});
DataTable dtCat = SqlHelper.GetTable("base_UserCategory_Select", new string[] { });
DataRow dr = dtCat.NewRow();
dr["UserCategoryID"] = 0;
dr["CategoryName"] = "< All >";
dtCat.Rows.InsertAt(dr, 0);

comboBoxEdit1.ItemsSource = dtCat.DefaultView;

comboBoxEdit1.SelectedIndex = 1;
DataRow dr=dtCat.NewRow(); dr[“UserCategoryID”]=0; dr[“CategoryName”]=“”; dtCat.Rows.InsertAt(dr,0); comboBoxEdit1.ItemsSource=dtCat.DefaultView; comboBoxEdit1.SelectedIndex=1;
我建议将LookupEdit控件与DataSource、DisplayMember和ValueMember属性结合使用。ComboBoxEdit控件没有ItemsSource属性