下拉列表应仅显示显示成员 [英] Dropdown should show only the display member
问题描述
我已经将一个集合绑定到 ultracombo
并且我已经指定了 value member
和 display member
.集合有很多列,现在我必须在显示中只显示一列,并将一列分配给 value member
.现在我看到集合中的所有 columns
都显示为 multicolumn
.
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
我怎样才能做到这一点?
How can I achieve that?
推荐答案
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屋!