qry in retrieving data in listbox

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
i developed a small project in asp.net

after retrieving the data form the backend ,i want to display the columns in listbox line by line
how is it possible.
or is there any other control to do it
thks.
 
Change the property of ListBox of MultiColumn = True which will allow you to show multiple items on the same line (like a complete row of DataTable) you can also use
CheckedListBoX with MultiColumn True
 
gripusa said:
Change the property of ListBox of MultiColumn = True which will allow you to show multiple items on the same line (like a complete row of DataTable) you can also use
CheckedListBoX with MultiColumn True
I think you have misunderstood what the Multiline property actually does. Here's a quote from the help topic:
A multicolumn list box places items into as many columns as are needed to make vertical scrolling unnecessary.
There is no relationship between the items on the same row in a multicolumn list box. If your list box has enough room for three rows, item four will be the first item in the second column. If you resize the list box to fit five rows, item six becomes the first item in the second column. If you want more than one field to be displayed in a ListBox you must either concatenate the fields to make a single string or switch to a ListView or DataGrid.

If you do only want one field displayed, you can either bind to a column of your DataTable or loop through the rows and add the desired field row by row.
 
Back
Top