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

Drop handler not called

3 Answers 147 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 18 Jun 2013, 06:31 PM
I just upgraded from the Q1 2013 WPF controls to Q2. I had already converted my app to the new DragDropManager and it was working. After upgrading however my drop handler was never called. My drop target is a RadTreeView, my source is a RadGridView (but I don't think that matters). In addition only certain nodes in my heterogeneous tree are drop targets. I register DragEnter/Leave and Drop handlers in the Loaded event for the data template of the valid tree nodes. Hence when a drag enters the valid node I update the visual cue, when it leaves I update it, and of course when you drop it handles the drop (or it did before Q2).  

After upgrading the drop handler was never called (although the DragEnter and Leave handlers worked fine). I tried all combinations of AllowDrop, IsDragDropEnabled, TreeViewSettings.DragDropExecutionMode = true, and everything else I could find. After MUCH experimentation I found that if I register a DragOver handler on the RadTreeView with exactly one line of code in it (e.Handled = true;) the Drop handler will get called. 

I am just curious if there is an easier way or if I missed something.

Regards
Dave Goughnour

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 21 Jun 2013, 07:19 AM
Hi Dave,

Can you check whether the RadTreeView is hosted in a RadDocking control? If it is, unfortunately this is a known issue and you found the workaround - handling the DragOver event.

If, however, you don't use RadDocking in your solution, can you try to isolate the issue in a small sample and send it over. We're eager to investigate the described behavior and we will highly appreciate your help with that.

Thank you in advance.

Regards,
Tina Stancheva
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
David
Top achievements
Rank 1
answered on 21 Jun 2013, 12:50 PM
I am in fact using the RadDocking control which I am quite happy with so I think I will live with having to overload the DragOver event :). The only issue I have is that in addition to wanting to be able to drop items dragged from external controls (and in fact external apps) I would also like some of the RadTreeView built in drag/drop behavior (i.e. moving nodes in the tree). But near as I can tell this is a case of you can't have your cake and eat it to. If I enable the built in drag/drop I loose the ability to drag from external sources. So I am guessing I will need to implement the internal drag/drop functionality I want myself? Not a big deal, but it would save a bit of time if I could use yours...

Thanks for the quick response.
Dave
0
Tina Stancheva
Telerik team
answered on 21 Jun 2013, 03:29 PM
Hi Dave,

Thank you for getting back to us. Actually, you can use the built-in RadTreeView drag/drop logic and still drop items from outside sources. Please have a look at this tutorial that demonstrates such an approach (you can also download a runnable sample from here) and let us know if this approach can work for you.

Regards,
Tina Stancheva
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DragAndDrop
Asked by
David
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
David
Top achievements
Rank 1
Share this question
or