• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1188
  • Last Modified:

asp.net treeview - how to remove/ hide the root node?

i have a asp.net tree view control and its being data bound to XML returned from the DB. once bound and the nodes are present in the control how can i remove/ hide the root node?

  • 2
1 Solution
Add XPath = "/*/*" to your XmlDataSource to not display the root node.
realcodingAuthor Commented:
im not using an XmlDataSource.

i have xml bound to the tree view that comes fromt eh SQL stored proc and it needs a top level node or else the XML wont be well formatted and SQL will error out.
I don't believe this is possible with the default TreeView control. You can hide the root element if you use a SiteMapDataSource. Your only other option is to find a custom TreeView that allows you to hide the root node.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now