Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to implement a MultiColumn ComboBox

Controls

How to implement a MultiColumn ComboBox

by  SBendBuckeye  Posted    (Edited  )
Here is a link to a MultiColumn ComboBox from The Code Project. It is an excellent control and source code is included. I am using it for one of my projects.

There is an article describing the code and also a message board pertaining to the code at the very end of the page.

http://www.codeproject.com/vb/net/MultiColumnFlatCombo.asp

You have to be a member to download code but all that is required is an email address and password.

Once you have installed it, while in the IDE, click on Tools, Add/Remove ToolBox items and then browse to the dll file and select it. The control will show up on the components area and can be drug onto a form design surface like any other combobox, textbox, etc.

Here are a couple gotchas I encountered:

1) If you are going to define SourceDataTable in code then set the Loading property to ComboboxItems at design time and then change it in your code when you set the SourceDataTable property.

2) You can use the standard combobox DataSource property for Tables and then you can use ValueMember and DisplayMember as you normally would. HOWEVER, if you are defining them in code, you MUST set up the SourceDataTable property first and THEN the DataSource, otherwise you will get an error.

3). It does not currently support filtering by using a DataView with a RowFilter. It will work, but the drop down portion will not draw properly.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top