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. Image for the cookie policy date
close icon

TreeViewAdv: Dragging over node expands it but interrupts Drag events?

Hello,

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?

Thanks!

8 Replies

BA Balavasanth Syncfusion Team 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.

Best,
Bala.


BA Balavasanth Syncfusion Team 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.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Sample-1908809519.zip

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

Best,
Bala.


KS Keith Steinbeck October 22, 2009 10:33 PM UTC

Bala,

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:

http://www.syncfusion.com/support/forums/tools-windows/90707/treeviewadv--determining-drag-state-inside-another-event?

Keith


MJ Mano J Syncfusion Team 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
}
else
{
// Rebuild nodes
}
}

Regards,
Mano


KS Keith Steinbeck October 23, 2009 04:37 PM UTC

Mano,

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.

Keith


GS Githanjali S Syncfusion Team November 12, 2009 01:48 PM UTC

Hi Keith,

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

http://www.syncfusion.com/support/forums/general/90707


Regards,
Githanjali


FB Felipe Bahiana Almeida 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


SK Senthil Kumaran Rajan Syncfusion Team 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)

        {

            this.treeViewDragHighlightTracker.ClearHighlightNode();
        }


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

Regards,
Senthil

Loader.
Live Chat Icon For mobile
Up arrow icon