Hiding a TreeView's root node

K

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)
 
S

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top