)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to show or hide column in WinForms ComboBox AutoComplete?

Platform: WinForms |
Control: ComboBoxAutoComplete |
Published Date: April 14, 2015 |
Last Revised Date: November 14, 2019

Show or hide the column

In 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: http://www.syncfusion.com/downloads/support/directtrac/135492/ComboBoxAutoCompleteSample1958689060.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon