我如何在 devexpress LookupEdit 的 itemList 上显示项目

发布于 2024-09-16 11:37:30 字数 661 浏览 1 评论 0原文

大家好,我在 C#.NET 项目中使用 DevExpress LookupEdit,还设置了 LookupEdit 的 Display Member 和 Value 成员属性,并且项目没有显示在 LookupEdit 列表页面上,但我可以选择项目。选择一项后,所选项目将显示在 LookupEdit 文本上。请帮忙

lkpReference.Properties.DataSource = _lab.selectLabReference() ;
lkpReference.Properties.DisplayMember = "refernce_name";
lkpReference.Properties.ValueMember = "lab_ref_id";
lkpReference.Properties.BestFitMode = BestFitMode.BestFit;
lkpReference.Properties.SearchMode = SearchMode.AutoComplete;

LookUpColumnInfoCollection collns = lkpReference.Properties.Columns;

collns.Add(new LookUpColumnInfo("Lab Reference", 0));
lkpReference.Properties.AutoSearchColumnIndex = 1;

Hai all, Am using DevExpress LookupEdit in C#.NET project,also set both Display Member and Value member property of LookupEdit and items are not dispaying on LookupEdit list page ,but i can select items. After selecting one item the selected item dispayed on LookupEdit text. Please help

lkpReference.Properties.DataSource = _lab.selectLabReference() ;
lkpReference.Properties.DisplayMember = "refernce_name";
lkpReference.Properties.ValueMember = "lab_ref_id";
lkpReference.Properties.BestFitMode = BestFitMode.BestFit;
lkpReference.Properties.SearchMode = SearchMode.AutoComplete;

LookUpColumnInfoCollection collns = lkpReference.Properties.Columns;

collns.Add(new LookUpColumnInfo("Lab Reference", 0));
lkpReference.Properties.AutoSearchColumnIndex = 1;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜味拾荒者 2024-09-23 11:37:30
lkpReference.Properties.DataSource = _lab.selectLabReference() ;
lkpReference.Properties.DisplayMember = "refernce_name";
lkpReference.Properties.ValueMember = "lab_ref_id";
lkpReference.Properties.BestFitMode = BestFitMode.BestFit;
lkpReference.Properties.SearchMode = SearchMode.AutoComplete;

// the constructor you are using accepts 2 parameters: FieldName (which is the name
// of the field from the DataTable) and Width (which is the width of the column
// displayed in the dropdown). You have set both parameters wrong.

//LookUpColumnInfoCollection collns = lkpReference.Properties.Columns;
//collns.Add(new LookUpColumnInfo("Lab Reference", 0));

// what you intended to do is this
lkpReference.Properties.Columns.Add(new LookUpColumnInfo("refernce_name", 100, "Lab Reference"));

lkpReference.Properties.AutoSearchColumnIndex = 1;
lkpReference.Properties.DataSource = _lab.selectLabReference() ;
lkpReference.Properties.DisplayMember = "refernce_name";
lkpReference.Properties.ValueMember = "lab_ref_id";
lkpReference.Properties.BestFitMode = BestFitMode.BestFit;
lkpReference.Properties.SearchMode = SearchMode.AutoComplete;

// the constructor you are using accepts 2 parameters: FieldName (which is the name
// of the field from the DataTable) and Width (which is the width of the column
// displayed in the dropdown). You have set both parameters wrong.

//LookUpColumnInfoCollection collns = lkpReference.Properties.Columns;
//collns.Add(new LookUpColumnInfo("Lab Reference", 0));

// what you intended to do is this
lkpReference.Properties.Columns.Add(new LookUpColumnInfo("refernce_name", 100, "Lab Reference"));

lkpReference.Properties.AutoSearchColumnIndex = 1;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文