Click here to Skip to main content
15,068,929 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to display values in two columns. Like there may be many posts in an organisation under 'Job' heading and similarly there may be many departments under 'Job Location'. Both values are stored in two separate tables and I have to show list of employees based on selection of a displayed value in ComboBox. One column will display 'Job' and 'Job Location' and second column will display sub item like Salesman, Accountant for Job category and Sales and Accounts Department for Job Location category.
Updated 9-Jul-12 17:13pm
Why so?
Anyway, we don't know exact type of ListBox you mean -- there are more then one. You need to tag your application type or UI library you use.

If you need on Web then i Have One Solution but that Paid tool...[^]

On web we can do that with help of javascript and code base.

And If you want in Windows then

Multi Column ComboBox[^]

Do you need to Select multi values in Combobox ?
Prasad_Kulkarni 10-Jul-12 0:32am
If you want to modify your answer then use "Improve solution" widget and update it. Don't add another solution if you are going to add some text in it.
Suvabrata Roy 10-Jul-12 0:53am
Actually that's my fault after submit solution I need to add some text so I pressed back button and add text and resubmit it therefor this mess happened.
I'm surprised that this question is asked again — I already answered a similar question. This is a very strange idea to abuse the control ListBox which is not designed to work with columns, while there are other controls to be used with columns. First of all, this is ListView. Another option is to use one of the controls called GridView of DataGridView.

Now, please see my comment to the question — from your question I cannot figure out which UI library you use. You could get more precise advice if you specified the exact type of ListBox and/or properly tagged the question. Not to worry: you will easily find all the relevant information in MSDN.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900