Home All Groups Group Topic Archive Search About
Author
23 Feb 2006 3:13 PM
Mariela Donkova
Hi everyone ,

I have a simple question :

How to display in a dropdownlist names which have spaces at the begining.
for example :
MainCategory
subcategory
   subsubcategory
     subsubsubcategory
I am trying to keep  hierarchy using spaces in dropdownlist
Regards,
Mariela

Author
25 Feb 2006 11:23 PM
Nathan Sokalski
I would suggest using   in place of the spaces. How you want to add
them is up to you, it probably depends on whether you get your data
dynamically or have a static list. Good Luck!
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Show quoteHide quote
"Mariela Donkova" <mari***@consultcommerce.com> wrote in message
news:eR2g0fSOGHA.3924@TK2MSFTNGP14.phx.gbl...
> Hi everyone ,
>
> I have a simple question :
>
> How to display in a dropdownlist names which have spaces at the begining.
> for example :
> MainCategory
> subcategory
>   subsubcategory
>     subsubsubcategory
> I am trying to keep  hierarchy using spaces in dropdownlist
> Regards,
> Mariela
>
>
Author
26 Feb 2006 10:55 PM
vMike
Show quote Hide quote
"Mariela Donkova" <mari***@consultcommerce.com> wrote in message
news:eR2g0fSOGHA.3924@TK2MSFTNGP14.phx.gbl...
> Hi everyone ,
>
> I have a simple question :
>
> How to display in a dropdownlist names which have spaces at the begining.
> for example :
> MainCategory
> subcategory
>   subsubcategory
>     subsubsubcategory
> I am trying to keep  hierarchy using spaces in dropdownlist
> Regards,
> Mariela
>
Here is a solution that was posted some time ago to add space in lists.

<%@ Page Language="VB" Debug="true" %>
<script language=VB runat=server>

Sub Page_Load(Sender As Object, E As EventArgs)

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

    Padding = "&nbsp;&nbsp;"
    Server.HtmlDecode(Padding, writer)
    Padding = writer.ToString()

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

    Padding = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
    Server.HtmlDecode(Padding, writer)
    Padding = writer.ToString()

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

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

End Sub

</script>
<html>
<head><title>Padding DropListBox</title></head>
<body><form fred runat="server"><asp:dropdownlist id="MyDropDownList2"
runat="server"/></form></body>
</html>

Mike