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

Update a node

1 Answer 81 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
SeRiAlKiL asked on 11 Sep 2008, 08:59 AM

I have a TreeView, wich loads node on demand server side from my database

The treeview is sourrounded by a RadAjaxPanel to avoid visible postbacks

I have added a ContextMenu wich works perfectly

I whould like to add a function to the context menu

When i click that menu voice, i whould like to force the node to collapse, and expand to reload his childs, like when i clicked it for the first time, or at least to collapse it, clear his old nodes and let te user to click again

Actually i am using this function

function ContextMenuClick(sender, args) {  
                    var menuItem = args.get_menuItem();  
                    var treeNode = args.get_node();  
                    var tree = $find("<%= TreePagine.ClientID %>");  
                    if (menuItem.get_text() == "Update") {  

But the expand() does not cause the load on demand of the childs, and also clicking the node does not cause the load on demand

There is a way to solve this?


1 Answer, 1 is accepted

Sort by
Veselin Vasilev
Telerik team
answered on 11 Sep 2008, 10:13 AM
Hi SeRiAlKiL,

When the node added its children after the first expand, its expand mode is changed to ClientSide. That is why on the second expand the NodeExpand server event does not fire.

I suggest that after clearing the nodes you set the expand mode of the root node to ServerSideCallBack like this:


I hope this helps.

the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question