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

[Solved] Removing Treenode from client and server side

1 Answer 165 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Web
Top achievements
Rank 1
Web asked on 11 Mar 2008, 01:28 PM
How can i remove a treenode through a contextmenu via clientside and serverside?

Right now i only can get it working on the cleintside but i also need it on Serverside. The RadTreeView1_ContextMenuItemClick is ignored as soon as i have the clientside working. If i remove the clientside code for the MenuItems the Serverside only works for the "New Folder". It seems "delete" never gets to the cleintside....

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 11 Mar 2008, 02:00 PM
Hello kerstin,

You could use the track/commit changes functions of the RadTreeView client object, which enables you to edit nodes and persist those changes on the server. In your case, nodes that are deleted on the client, when an item in the context menu is clicked, will also be deleted on the server:
  • treeView.trackChanges(); - indicates that client-side changes are going to be made and these changes are supposed to be persisted after postback.
  • treeView.commitChanges(); - submits the changes to the server.
        var treeView = $find("RadTreeView1"); 
treeView.trackChanges();
//add, remove, disable nodes
treeView.commitChanges();
I hope this information helps.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Web
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or