Click here to Skip to main content
Click here to Skip to main content

Auto Complete Multi Column ComboBox

, 6 Oct 2005
Rate this:
Please Sign up or sign in to vote.
This is my version of an auto completing mutli column ComboBox.

Sample Image


I have seen a few other multi column combo boxes and auto complete combo boxes so I decided to submit this code that does both.


A while ago I needed to move a project from MS Access to C#. In Access it was using a lot of their nifty columned combo boxes and our customers would struggle mightily if there were any changes to this functionality. Thus the ColumnComboBox was born.

Using the code

This class can be used like any other ComboBox except the Items should be set using the Data property. This is a DataTable from which the ColumnComboBox gets all the data for filling the drop down box. Simply fill a DataTable as desired and then set the Data property with it.

//set the Data of the ColumnComboBox
myColumnComboBox.Data = myDataTable;

You can then set the column that will be displayed as the text of the combo box.

//set the ViewColumn
myColumnComboBox.ViewColumn = 2;

Any columns that you don't want to display in the drop down can be hidden like this:

//Set a few columns to not be shown
myColumnComboBox.Columns[1].Display = false;
myColumnComboBox.Columns[3].Display = false;

There are a few other properties to play with such as being able to turn auto complete off (myColumnComboBox.Suggest = false;) or an indexer for getting values from columns at the current rows.

Points of Interest

The code uses a few helper classes that are included either below the ColumnComboBox class or in another included file (StringList). The source for the ColumnComboBox is commented if you want to poke around yourself. I for one will be happier when/if they get templates into C#.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author


United States United States
No Biography provided

Comments and Discussions

QuestionGood Article Pinmemberdemouser74310-Jul-13 10:15 
Generalthank you for posting article PinmemberAarti Meswania6-Dec-12 22:30 
QuestionAssign a value to the ValueMember property, with data loaded from a DB Pinmemberronaldnin16-Jul-12 11:04 
QuestionCystral report calculation Pinmemberkwamebounty24-Jan-12 22:45 
QuestionAdding a new header for each Columns PinmemberMember 321560111-Jan-12 1:32 
GeneralMy vote of 5 Pinmemberfariborz sadighi13-Apr-11 0:32 
GeneralSelectedIndex issue [Solved] Pinmemberimpy12-Jun-10 3:05 
GeneralRe: SelectedIndex issue [Solved] PinmemberRedDude8-Mar-11 11:57 
QuestionHow can I show the column name PinmemberNelio Sotomayor9-Dec-09 6:39 
Questionhow to use in datagridview Pinmembermkhalid0079-Jul-09 12:11 
Generalcolumn headers Pinmemberarevans19-Nov-08 7:07 
GeneralRe: column headers Pinmemberewansw30-Dec-08 5:43 
Generalget only one value PinmemberJM ® - DE CASTRO30-Apr-08 4:22 
GeneralRTL PinmembernETbKA19-Apr-07 5:34 
GeneralRe: RTL Pinmembercavoli119-Apr-07 6:12 
GeneralRe: RTL PinmembernETbKA21-Apr-07 23:37 
GeneralRe: RTL Pinmembercavoli123-Apr-07 5:01 
GeneralIndexed items with sorted list Pinmemberdave.kelly28-Feb-07 22:11 
GeneralRe: Indexed items with sorted list Pinmembercavoli11-Mar-07 6:05 
GeneralRe: Indexed items with sorted list Pinmemberdave.kelly1-Mar-07 21:55 
GeneralRe: Indexed items with sorted list Pinmembercavoli11-Mar-07 6:14 
GeneralSet Selected Index Pinmembersalah_gis22-Feb-07 0:35 
GeneralRe: Set Selected Index Pinmembercavoli11-Mar-07 6:13 
QuestionMouse pointer dissapears Pinmemberfonk6668-Feb-07 11:01 
AnswerRe: Mouse pointer dissapears Pinmembercavoli19-Feb-07 5:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150129.1 | Last Updated 6 Oct 2005
Article Copyright 2005 by cavoliotmail.com1@h
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid