in a ListItem doesn't seem to work

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,
 
B

bruce barker

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

-- bruce (sqlwok.com)
 
V

vMike

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top