将数据表中的值放入 DevExpress 组合框编辑项目中
谁能解释一下,如何简单地将数据表中的值放入 DevExpress 组合框编辑项中?在 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;
如何像这样向 DevExpress 组合框编辑赋值?
Can anyone explain, how to simply put values from a DataTable in DevExpress comboBoxEdit Items? In WinForms it was simply like this:
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;
How to assign values to a DevExpress comboBoxEdit like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议改用 LookupEdit 控件,并结合 DataSource、DisplayMember 和 ValueMember 属性。 ComboBoxEdit 控件没有 ItemsSource 属性。
I would recommend using a LookupEdit control instead, in conjunction with the DataSource, DisplayMember and ValueMember properties. The ComboBoxEdit control does not have an ItemsSource property.