Solved

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

Posted on 2010-11-12
3
1,085 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 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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