Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there.

I want to add multiple columns to a Listbox through 3-tier architecture. Currently everything works fine except that it only adds one column and not the two.
WORKING CODE (PRESENTATION LAYER)
lstClass = blayer.GetListClass((int)number, (string)name); 
listBox2.DataSource = lstClass;  
listBox2.ValueMember = "classId";
listBox2.DisplayMember = "className"; 

I want to add both classId & className to the Listbox. I've tried multiple solutions but none work. Any advise please?

Regards
Posted
Updated 26-Jul-11 23:00pm
v2

ListBox doesn't support multiple columns. Use a ListView.
 
Share this answer
 
listBox1.Items.Add("Class Id\tClass Name");

When i do it that way, it works perfectly fine but i cant do it for multiple data through 3-tier. Thank you Shameel. I will give it a go.

Regards
 
Share this answer
 

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