We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeViewAdv Multiple Drag & Drop?

Thread ID:





93672 Mar 28,2010 04:53 PM UTC Apr 6,2010 03:22 PM UTC WinForms 5
Tags: Tools
Asked On March 28, 2010 04:53 PM UTC

Hi, Do you have a sample on how to achieve dragging and dropping of multiple nodes in a TreeViewAdv?

I have been playing about with it but can only seem to get one node to drag at a time. I have allowed multiple selections in the tree.


Vallarasu S [Syncfusion]
Replied On March 30, 2010 03:33 PM UTC


Thanks for your interest in Syncfusion in products.

Multiple node drag and drop can be achieved by using below way.

// Get the Selected Nodes text In the array
foreach (TreeNodeAdv node in treeView.SelectedNodes)
index[i++] = node.Text;

// Nodes in the index array are then moved to destination node index.
for (i = 0; i < index.Length; i++)
int insertIndex = -1;
for (int j = 0; i < treeView.Nodes.Count;j++ )
TreeNodeAdv nodes = treeView.Nodes[j];
if (nodes.Text.Equals(index[i]))
insertIndex = j;
treeView.Nodes[insertIndex].Move(destinationNode, NodePositions.Next);

Please refer the sample in the below link which illustrates the above.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=TreeNodeAdv Content-179293235.zip

Please try this and let me know if this helps.

Vallarasu S.

Replied On March 30, 2010 05:53 PM UTC

Thanks but that sample doesn't work as intended.

It doesn't drop in the correct position above/below the target node, and the nodes are dropped in reverse order.

Vallarasu S [Syncfusion]
Replied On March 31, 2010 03:23 PM UTC

Hi, David

Thank you for the update.

Please refer the modified sample from below link to achieve your requirement.


Please let me know if you have any queries.

Vallarasu S.

Replied On April 3, 2010 12:42 AM UTC

Thanks that works well.

Sorry to be a pain again, but it seems to only work when the nodes are on the root level. Once I drop them into a sub-folder node they no longer are draggable.

I'm trying to provide as much flexibility as possible so that multiple dragging/dropping can be achieved on any node level.

I've tried changing anywhere you had 'Nodes' to 'SelectedNodes' but it didn't work.

Could you please state what changes would have to be made so that multiple dragging/dropping will work on any level, and can be dropped to any level.

Thanks again for you samples.

Vallarasu S [Syncfusion]
Replied On April 6, 2010 03:22 PM UTC

Hi, David

Thanks for your update.

Please refer the modified sample from below link for multiple node drag and drop at subnode level in TreeNodeAdv Control.


Please let me know if you have any queries.

Vallarasu S.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon