|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DropDownList and SpacesHi 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 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! 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 > >
Show quote
Hide quote
"Mariela Donkova" <mari***@consultcommerce.com> wrote in message Here is a solution that was posted some time ago to add space in lists.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 > <%@ 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 = " " 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") 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
ASP.NET 2.0 Easier than ASP? Gimmie a Break!
GridView and XmlDataSource Trouble removing cookies TabStrip - create tabs dynamicly on client-side Trouble with DataList Control Trouble with the DataList Control Compare Validator for Date AND Time hyperlink in a Calendar Control ASP.Net 2.0 Table not expanding 100% GridView DataFormatString only works on Integers |
|||||||||||||||||||||||