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

Load on demand and add node

3 Answers 67 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Blair
Top achievements
Rank 1
Blair asked on 20 Jun 2012, 11:35 AM

Hello,

 

I’ve implemented the RadTreeView with load on demand using ExpandMode = ServerSideCallback. I’ve also implemented context menus to allow users to add nodes dynamically. The problem I’m having is figuring out how to render the tree and expand to the newly added node. Since the load on demand only loads the top level nodes, the added node won’t be visible on postback in cases where the new node is a couple of levels deep.

 

I would appreciate any suggestions.

 

Also, I’ve implemented drag and drop which is going to be a problem too. So any suggestion for that would be helpful too.

 

Blair

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 25 Jun 2012, 07:57 AM
Hello Blair,

The load on demand mechanism doesn't have a restriction on the number of node levels you can load in a single web service call. For instance you can do the following:
void RadTreeView1_NodeExpand(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
    RadTreeNode node = new RadTreeNode("child");
    RadTreeNode child = new RadTreeNode("grandchild");
    node.Nodes.Add(child);
    node.Expanded = true;
    e.Node.Nodes.Add(node);
}

 
All the best,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Blair
Top achievements
Rank 1
answered on 25 Jun 2012, 10:59 AM
Bozhidar,

Thanks for the reply. I've managed to get past that point. Thanks anyway. I have another problem related to the ServerSideCallback load on demand.

I'm trying to implement tree navigation outside the tree using buttons like Previous and Next. When I get to a node that requires expanding I'm calling expand() client side. I see the spinner next to the node, but it never expands. I noticed server side the NodeExpand and the client side onClientNodePopulating is called, but the onClientNodePopulated is never called. I connected up the onClientNodePopulatingFailed event, but its never fired.

Any ideas?

Thanks.
Blair

0
Blair
Top achievements
Rank 1
answered on 25 Jun 2012, 12:00 PM
I figured it out. There was a postback after the callback.

Thanks.
Tags
TreeView
Asked by
Blair
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Blair
Top achievements
Rank 1
Share this question
or