下拉菜单应该只显示显示成员 [英] Dropdown should show only the display member
问题描述
我已经绑定了一个集合到 ultracombo
,我已经指定值成员
和显示成员
。集合有许多列,现在我只需要在显示中显示一个列,并且一个列分配给值成员
。现在我看到集合中的所有列
显示为多列
。
I have bound a collection to ultracombo
and I have specified the value member
and display member
. The collections have many columns, Now I have to show only one column in that in display and one column assigned to value member
. Now i'm seeing all the columns
in the collections are getting displayed as multicolumn
.
//代码
cboUltra.ValueMember = "LookupValue"
cboUltra.DisplayMember = "LookupValueDescription"
cboUltra.DataSource = LoadLookupDetails(Field.LookUpCode)
UltraGridRow.Cells("FieldValue").ValueList = cboUltra
如何实现?
推荐答案
UltraCombo将生成所有列。您可以在设置数据源之前添加所需的列,并将cboUltra.DisplayLayout.NewColumnLoadStyle设置为NewColumnLoadStyle.Hide,也可以通过在InitializeLayout事件中循环创建它们之后隐藏所有列,
The UltraCombo will generate all of the columns automatically. You could either add the column you want before setting the data source and set cboUltra.DisplayLayout.NewColumnLoadStyle to NewColumnLoadStyle.Hide or you could hide all of the columns except the one you want after they are created by looping through them in the InitializeLayout event and setting them all to hidden except the one that you want.
您还可以查看 UltraComboEditor ,因为它只显示一个列。这是一个选项,你将取决于你需要在你的下拉菜单中的功能。
You could also look at the UltraComboEditor as that only displays a single column. Whether this is an options for you will depend on what features you need in your drop down.
这篇关于下拉菜单应该只显示显示成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!