Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-11-12
3
Medium Priority
?
1,142 Views
Last Modified: 2012-05-10
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?

thanks!
0
Comment
Question by:realcoding
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
ssims45 earned 2000 total points
ID: 34122520
Add XPath = "/*/*" to your XmlDataSource to not display the root node.
0
 

Author Comment

by:realcoding
ID: 34122675
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.
0
 
LVL 1

Expert Comment

by:ssims45
ID: 34122848
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.
0

Featured Post

Vim Reference Guide

Vim is a powerful text editor favored by many sysadmins and developers - here are some commands that you'll want to keep in your back pocket!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question