B
BobLaughland
Hi All,
In ASP .NET I have a listbox like this,
<asp:ListBox id="listbox" Height="600" Width="1000" runat="server">
</asp:ListBox>
I want to add items to the listbox (which I am reading out of a
database). Some of those items should appear as one item in the
listbox, but on multiple lines (don't confuse this with multiselect!)
How do I do it?
Let's explain it a bit different, I want to do something like this,
List<string> items = new List<string>();
listbox.DataSource = items;
items.Add("Text to appear on first line \r\n text to appear on
second line");
So in a single selection in the listbox it should have both of the
lines above, and they should be one at the top, and one on the next
line.
But you see that code does not work. I have tried \n, <br\> and many
combinations of the <, > characters but nothing seems to work.
In ASP .NET I have a listbox like this,
<asp:ListBox id="listbox" Height="600" Width="1000" runat="server">
</asp:ListBox>
I want to add items to the listbox (which I am reading out of a
database). Some of those items should appear as one item in the
listbox, but on multiple lines (don't confuse this with multiselect!)
How do I do it?
Let's explain it a bit different, I want to do something like this,
List<string> items = new List<string>();
listbox.DataSource = items;
items.Add("Text to appear on first line \r\n text to appear on
second line");
So in a single selection in the listbox it should have both of the
lines above, and they should be one at the top, and one on the next
line.
But you see that code does not work. I have tried \n, <br\> and many
combinations of the <, > characters but nothing seems to work.