I found it in this link: http://snippets.dzone.com/posts/show/6840

text = Server.HtmlDecode(" ") + row("Name")

=D

On Aug 28, 10:02 am, Ana <[email protected]> wrote:
> Hi,
>
> I tried to use the same line in the DropDownList, but it's not
> working.
> If I use: text = "&nbsp;&nbsp;" + row("Name") and ddl.Items(x) = text,
> the item in the DropDownList will be: &nbsp;&nbsp;Name
> If I use: text = "  " + row("Name") and ddl.Items(x) = text, the item
> in the DropDownList will be: Name (without blank spaces)
>
> Is there a way to put blank spaces in the DropDownList elements?
>
> Thanks,
>
> Ana
>
> On Aug 27, 11:49 am, Ana <[email protected]> wrote:
>
> > It works =D
> > Thanks!
>
> > On Aug 27, 11:23 am, Cerebrus <[email protected]> wrote:
>
> > > When working with web pages, remember that browsers often do not
> > > render spaces as such. This might be one possible reason why your
> > > simulated indentation does not work.
>
> > > Try using "&nbsp;" as a non-breaking space:
> > > newName = "&nbsp;&nbsp;" + row("Name")
>
> > > On Aug 27, 9:47 pm, Ana <[email protected]> wrote:
>
> > > > Hi,
>
> > > > In my page I have a GridView and I'm binding it in the code behind.
> > > > The data in my gridView should appear similar to a directory structure
> > > > (but in my case using a TreeView doesn't apply). So my GridView should
> > > > be like this:
>
> > > > Name 1
> > > >     Name 1.1
> > > >     Name 1.2
> > > > Name 2
> > > >     Name 2.1
> > > >         Name 2.1.1
>
> > > > To do this, I'm updating the value for the column "Name" in the
> > > > DataTable used to populate the GridView. For example, for Name 1.1,
> > > > I'm doing:
> > > > newName = "    " + row("Name")
> > > > row("Name") = newName

Reply via email to