Articles in this section
Category / Section

How to show or hide column in WinForms ComboBox AutoComplete?

1 min read

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

Sample: https://files2.syncfusion.com/login?ReturnUrl=%2Fdtsupport%2Fdirecttrac%2F135492%2FComboBoxAutoCompleteSample1958689060.zip


Conclusion

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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!



Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied