View previous topic :: View next topic |
Author |
Message |
eduigal
Joined: 19 Mar 2007 Posts: 6
|
Posted: Tue Mar 20, 2007 10:14 am Post subject: Unexpected Drag and Drop Events |
|
|
I have odd problem with the drag and drop, when i use my own events to handle the rows drag and drop the an unexpected drag and drop event fired (when i make structureal changes).
Does structureal changes in the tree can cause drag and drop events to fire? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Mar 20, 2007 9:46 pm Post subject: |
|
|
Quote: | Does structureal changes in the tree can cause drag and drop events to fire? |
No - the only thing that should cause drag/drop events to fire is user interaction. What event is being fired? Can you reproduce this in a sample you could email to us? _________________ Infralution Support |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
eduigal
Joined: 19 Mar 2007 Posts: 6
|
Posted: Wed Mar 21, 2007 6:44 am Post subject: |
|
|
I will try to reproduce this in a sample code, what about returning from open file dialog that opened above(hides the virtual tree) the virtual tree?it is possible that some mouse actions cause the drag and drop event to fire? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Mar 21, 2007 8:38 am Post subject: |
|
|
Mouse events may possibly cause the events to fire. Put a break point in your event handler and take a look at the call stack - that may tell you something. _________________ Infralution Support |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
eduigal
Joined: 19 Mar 2007 Posts: 6
|
Posted: Wed Mar 21, 2007 3:45 pm Post subject: |
|
|
I did it and the call stack took me back to the main thread message loop.
I clear the GetRowDropEffect event (let virtual tree to handle it) and handle myself the other events and it fixed the problem for me.
is it possible that GetRowDropEffect event cause the problem?
here is the method:
Code: | private void mVirtualTree_GetRowDropEffect(object sender, Infralution.Controls.VirtualTree.GetRowDropEffectEventArgs e)
{
e.DropEffect = DragDropEffects.Move;
} |
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Mar 21, 2007 9:11 pm Post subject: |
|
|
The only time the GetRowDropEffect event is fire is during a drag operation (from either the DragEnter or DragOver or DragDrop events). The drag operation could be initiated from a control other than VirtualTree - then if you drag your mouse over VirtualTree you would receive these events. _________________ Infralution Support |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
eduigal
Joined: 19 Mar 2007 Posts: 6
|
Posted: Thu Mar 22, 2007 7:54 am Post subject: |
|
|
Thanks for your help |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|