Drop handler not called

4 posts, 0 answers
  1. David
    David avatar
    27 posts
    Member since:
    Apr 2013

    Posted 18 Jun 2013 Link to this post

    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
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 Jun 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    27 posts
    Member since:
    Apr 2013

    Posted 21 Jun 2013 Link to this post

    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
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 Jun 2013 Link to this post

    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.

Back to Top