raphael232
Programmer
Hi, i'm trying to create a drop down list of categories that has indenting based on how deep the category is. I have the following code:
And as you can see i have added a prefix on Item.Text which adds 3 spaces (or so i would hope). The trouble is that is being replaced with   when it is rendered on the page.
Until now I have just used # to indent the text but I was wondering if there is a solution to this problem. Appreciate the help. Thanks
Code:
Dim Items As New ListItemCollection
For Each Row In Categories
Dim Item As New ListItem
Item.Text = " " & Row.fldCategory
Item.Value = Row.ID
Items.Add(Item)
Next
lstCategoryID.DataSource = Items
lstCategoryID.DataTextField = "Text"
lstCategoryID.DataValueField = "Value"
lstCategoryID.DataBind()
And as you can see i have added a prefix on Item.Text which adds 3 spaces (or so i would hope). The trouble is that is being replaced with   when it is rendered on the page.
Until now I have just used # to indent the text but I was wondering if there is a solution to this problem. Appreciate the help. Thanks