Search code examples
vb.netcomboboxinfragistics

Dropdown should show only the display member


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.

//Code

 cboUltra.ValueMember = "LookupValue"
 cboUltra.DisplayMember = "LookupValueDescription"
 cboUltra.DataSource = LoadLookupDetails(Field.LookUpCode)
 UltraGridRow.Cells("FieldValue").ValueList = cboUltra

How can I achieve that?


Solution

  • 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.

    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.