Declan Basile
asked on
Multiple Column Listbox in VB.net
I'm a veteran Microsoft Access developer now working in vb.net. To create a multiple column listbox with column headers in Access I simply had to set the ColumnCount property to the number of columns and the ColumnHeads property to "Yes". Now using the listbox control in VB.net it looks like I only have an opportunity to specify one column of data to be displayed by setting the "DisplayMember" property. Ultimately I need to present the user with a popup form the has 7 columns of data (there should never be more than 10 rows) and return a value (not displayed but associated to that row) after the user double clicks one of the rows). I realize I could format the displayMember's data into tabbed columns myself, but have to believe there's a better way. I also know about the multicolumn property but this is not what I need, for that just displays one column (i.e. field) of the datasource in multiple columns. How else can I accomplish this in VB.net? Is there a third party listbox control that I could use? Would I be better off using the datagridview control to display multiple columns of data even though the user doesn't have to (in this case) edit the data but just has to double click one of the rows?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The DataGridView worked well for me. Thank you.
Open in new window
you'll see columns in a listboxYou can specify column width
Open in new window
Knowing column width you can add "headers" as labels above listbox