views:

591

answers:

2

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

A: 

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.

Brian David Berman
A: 

Hi Brian,

Do you have a sample on how you were able to accomplish the desired function? I am trying to build the context menu/edit/refresh.

Thanks, Dave [email protected]

Dave