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

How to do the basic setup for RadTreeView using drag and drop with context menu?

1 Answer 40 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ritika Gupta
Top achievements
Rank 1
Ritika Gupta asked on 20 Jan 2010, 06:19 AM
Hi,

I need to set up RadTreeView for ASP.NET AJAX ( drag and drop with context menu).
Any help - documentation, codes etc on how to go about this is appreciated.

Many Thanks,
Ritika

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Jan 2010, 08:27 AM
Hello Ritika,

In order to use the drag and drop functionality in treeview, you can simply set the RadTreeView with EnableDragAndDrop="True" and you will be able to drag and drop TreeNodes.

Also RadTreeView supports its own context menus- Demo.

Now, if you want to move the nodes using the contextmenu (ie, right-clicking a node and selecting 'Move node' and then right clicking another node and selecting 'Drop here'), then one suggestion is,

In the OnClientContextMenuItemClicked event, remove the node from the source node collection and then add create a new instance of node and then add the node in the dropped node collection (according to menuitm clicked). You can refer the following demo which will help you in adding and removing the nodes.
Add/Remove/Disable Nodes

Hopes this suggestion helps,
Shinu.
Tags
TreeView
Asked by
Ritika Gupta
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or