This is a migrated thread and some comments may be shown as answers.

Navigation Type TreeView - Avoid Rendering Hidden Nodes

1 Answer 68 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
gfaus
Top achievements
Rank 2
gfaus asked on 19 Mar 2009, 04:16 PM
I have a TreeView instance that is bound to a SiteMapXmlData source.  All nodes have a bound NavigateUrl property.   I'm utilizing the tree view as a means to navigate a website.

How do I avoid rendering the HTML mark-up for nodes that are not displayed (e.g. not expanded)? Currently all of these nodes are hidden via "display:none".  Since I'm posting back on every click there is no need to toggle node visibility client-side which creates a lot of extra mark-up which I like to avoid.

Neither the NodeCreated and NodeDataBound events seem to help to determine what nodes get written out with "display:none" style.  The node "Visible" properties are always true and the attribute "display" is empty.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Mar 2009, 05:07 PM
Hi gfaus,

RadTreeView renders all tree nodes added in the Nodes collection no matter if they are initially visible or not. If you want to hide nodes that are not expandable you should traverse their parent nodes to see if they are expanded.

Regards,
Albert
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
gfaus
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Share this question
or