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: Dragging over node expands it but interrupts Drag events?

Thread ID:





90656 Oct 12,2009 06:13 PM UTC Nov 27,2015 07:07 AM UTC WinForms 8
Tags: TreeViewAdv
Keith Steinbeck
Asked On October 12, 2009 06:13 PM UTC


In my TreeViewAdv when I drag a node over a collapsed node it expands (good) but afterward no drop target in the tree is valid. I have to stop dragging and drag again.

It seems like the node expand event is interrupting the drag event. I've tried messing with QueryContinueDrag but haven't been successful. How do I continue a DragDrop operation in this case?


Balavasanth [Syncfusion]
Replied On October 13, 2009 10:58 AM UTC

Hi Keith,

Thanks for your interests in Syncfusion products.

We are able to reproduce your issue. We have logged defect report on your issue. The fix for this issue will be available along with our VOL-1 main release scheduled by January 2010. We really appreciate your patience.

Please let us know if you have any queries.


Balavasanth [Syncfusion]
Replied On October 14, 2009 12:20 PM UTC

Hi Keith,

We tried a simple sample as per your description. We tried to drag and drop the Node over a collapsed node. Even then we were able to Drag Drop the dropped node or any node from the TreeViewAdv without any issues. Please find the sample from the below location.


Please let us know if you have any queries. Kindly let us know if we are missing anything by any chance.


Keith Steinbeck
Replied On October 22, 2009 10:33 PM UTC


Thanks for the reply. It turns out that something I was doing in the Expand event was rebuilding the tree behind the scenes. This was causing all the drop targets to be invalid.

All I needed to do was prevent the code from being executed in cases where the Expand was caused by a Drag operation. However, there are some issues with this as I've described in this post:



Mano J [Syncfusion]
Replied On October 23, 2009 01:05 PM UTC

Hi Keith,

Can you try as shown below by adding a bool flag?

private bool nodeUnderDrag = false;

private void treeViewAdv_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
nodeUnderDrag = true;

private void treeViewAdv_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
nodeUnderDrag = false;

void treeViewAdv1_BeforeExpand(object sender, TreeViewAdvCancelableNodeEventArgs e)
if (nodeUnderDrag)
e.Cancel = true; // cancel the expand operation
// Rebuild nodes


Keith Steinbeck
Replied On October 23, 2009 04:37 PM UTC


The approach you suggested is actually what I'm doing now. HOWEVER, this leaves at least one edge case where the bool cannot be properly set (releasing the mouse button while dragging over an invalid target cancels drag but fires no events). Please see my other post regarding this issue; the link is included in my previous comment.


Githanjali S [Syncfusion]
Replied On November 12, 2009 01:48 PM UTC

Hi Keith,

Kindly refer to the following post for further updates regarding the particular issue:



Felipe Bahiana Almeida
Replied On November 25, 2015 02:55 PM UTC

this does not work on my example and the address provided is even less informative.

I followed the sample of the drag and drop of countries and continents but sometimes when I release the mouse button, the highlighter get stuck and the node does not change position.

Attachment: error_treeview_drop_7b3f6272.zip

Senthil Kumaran Rajan [Syncfusion]
Replied On November 27, 2015 07:07 AM UTC

Hi Felipe,

Thank you for your update.

This reported behavior can be achieved by handling the DragLeave event in the TreeViewAdv and using ClearHighlightNode function in the TreeViewDragHighlightTracker. Please use the below code example for further reference.

Code Example[C#];

  private void treeViewAdv_DragLeave(object sender, System.EventArgs e)



We have prepared the sample for your reference and it can be download from here.

Sample : http://www.syncfusion.com/downloads/support/forum/90656/ze/TreeViewAdvDragDrop1360135958



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

or the page will be automatically redirected to 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