How to show or hide column in WinForms ComboBox AutoComplete?
Show or hide the column
In WinForms ComboBoxAutoComplete control, you can customize the visibility of columns collection in its drop-down window by using the AutoCompleteDataColumnInfo class. The following code example is to demonstrate the same.
C#
//To display only required column this.comboBoxAutoComplete1.AutoCompleteControl.RefreshColumns(); foreach (AutoCompleteDataColumnInfo column in this.comboBoxAutoComplete1.AutoCompleteControl.Columns) { if (column.ColumnName != this.comboBoxAutoComplete1.DisplayMember) { column.Visible = false; } else { column.Visible = true; } }
VB
'To display only required column Me.comboBoxAutoComplete1.AutoCompleteControl.RefreshColumns() For Each column As AutoCompleteDataColumnInfo In Me.comboBoxAutoComplete1.AutoCompleteControl.Columns If column.ColumnName <> Me.comboBoxAutoComplete1.DisplayMember Then column.Visible = False Else column.Visible = True End If Next column
I hope you enjoyed learning on how to show or hide column in WinForms ComboBox AutoComplete.
You can refer to our WinForms ComboBox AutoComplete featuretour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!