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

Removing Child Nodes

1 Answer 69 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 25 Jun 2010, 06:58 PM
Okay, after a considerable amount of reading, trial and error, and general fussing with code I've got a RadTreeView that I can expand, you click a link and will remain expanded when the new page loads, However; repeating this on collapse appears to be problematic for me still. I have the system look for the child nodes and add them dynamically when the user expands a node. I need to be able to do the same for collapsing.

What I can't seem to find is a way to find all the nodes with parent (node you just collapse), if I could do that I can just code it to remove all of them.

Alternatively if there is a simple "remember what my treeview has" in session that would be excellent as I've been programming the whole thing to check the session, when you expand a node add child nodes to it, etc. if anyone has any recommendations or advise I'd really appreciate it.

-Eric

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 30 Jun 2010, 02:39 PM
Hello Eric,

In order to persist the state of the treeView you can use the GetXml method over the RadTreeView and save it into the session and later on to load it through the LoadXml method.

About finding the child nodes of the one being collapsed:
server-side:
RadTreeNodeCollection collapsedNodesChildren = collapsedNode.Nodes;


client-side:
var collapsedNodesChildren = collapsedNode.get_nodes();

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Eric
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or