Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

914 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now