in a ListItem doesn't seem to work

  • Thread starter Thread starter Bill Green
  • Start date Start date
B

Bill Green

I am trying to add an indent to a Dropdown control. I prefix the text for
the ListItem with a couple   but it doesn't render the tags to spaces ,
instead the dropdown list shows:

MainItem
  SubItem
  SubItem

Thanks,
 
the list item's text property does not support html, only text

-- bruce (sqlwok.com)
 
Here is a solution to that problem that was posted some time ago by someone
else.

Dim Padding As String
Dim writer As New System.IO.StringWriter()
Dim DecodedString As String

Padding = "  "
Server.HtmlDecode(Padding, writer)
Padding = writer.ToString()

myDropDownList2.Items.Add(Padding & " MVP's")

Padding = "        "
Server.HtmlDecode(Padding, writer)
Padding = writer.ToString()

myDropDownList2.Items.Add(Padding & " MVP's")

myDropDownList2.Items.Add("MVP's" & Padding & "Do Their best")
 
Back
Top