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

[Solved] RadTreeView Load-On-Demand selection problem

1 Answer 190 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Brian Berman
Top achievements
Rank 1
Brian Berman asked on 13 Mar 2010, 09:56 PM
I am currently using a RadTreeView and just switched over to using Load-On-Demand (ServerSideCallback) to improve performance.  On each node, I use a RadContextMenu to pop open a RadWindow.  In the RadWindow, I update information about the node I selected in the RadTreeView (such as changing it's name, etc.).  When I close the RadWindow, I trigger the RadTreeView to rebind (since I made changes and want to get the freshest data).  My problem is, when I am 4 or 5 levels deep into the tree, I have no way to reselect the node that I came from.  This was easy when I wasn't using Load-On-Demand since all the nodes were just part of the tree.  How can I do this now that I am using Load-On-Demand?

I already wrote a method to do the work in getting ALL the parentIds that lead up to the node in question.  For example, for the given tree:

A
|__ B
|__ C
|__ D
      |__ E
      |__ F

Let's say after I rebind, I wanted to get back to "F", I already have a method that returns "A,B,F", which is the fully qualified path back to "F".

Thanks,
Brian

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 17 Mar 2010, 10:10 AM
Hi Brian Berman,

Here is a compilation of my replies to your support ticket:

In this case you need to set the ExpandMode of all the parents of that node to ClientSide.
Otherwise the first parent will not be expanded (that is the idea of the load on demand) and the node in question would not be visible.

Alternatively, you can find the first parent and call its expand() javascript method, then in OnClientNodePopulated event find the next parent and call its expand() method and so forth until you get to the desired node.

Still, I think the first approach is the better.



Please call the SelectNode method in the response scripts of the AjaxManager - in AjaxRequest server event add this page:

RadAjaxManager1.ResponseScripts.Add("SelectNode('" + PathToSelectedNode.Value + "')");



Greetings,
Veskoni
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
Brian Berman
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or