Home All Groups Group Topic Archive Search About
Author
11 Nov 2005 5:39 PM
Keith Patrick
What is the best (if there is such) way to hide a tree view's root node?
The RootNodeStyle property lacks a "visibility" property, so I can either
assign a CssClass="Hidden", which translates to display:none or override the
render method to manually do it, but I was curious if there is a better way
that I'm not seeing.  (I'd also ideally like to hide any node without a text
label, but it isn't critical, whereas I really would like to remove the root
altogether rather than just render it with no text)

Author
14 Nov 2005 8:29 PM
Steve C. Orr [MVP, MCSD]
If you are binding an ASP.NET 2.0 Treeview control to a SiteMapDataSource
then you can simply set SiteMapDataSource.ShowStartingNode = false

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net



Show quoteHide quote
"Keith Patrick" <richard_keith_patrick@nospam.hotmail.com> wrote in message
news:eaTgSbu5FHA.1032@TK2MSFTNGP11.phx.gbl...
> What is the best (if there is such) way to hide a tree view's root node?
> The RootNodeStyle property lacks a "visibility" property, so I can either
> assign a CssClass="Hidden", which translates to display:none or override
> the render method to manually do it, but I was curious if there is a
> better way that I'm not seeing.  (I'd also ideally like to hide any node
> without a text label, but it isn't critical, whereas I really would like
> to remove the root altogether rather than just render it with no text)
>
Author
16 Nov 2005 2:38 AM
Keith Patrick
That worked perfectly.  Thanks!