Simple Basic D&D

2 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 25 Apr 2013 Link to this post


    I play around with DDManager and my desired solution is:
    I have a grid - in this Grid I have several Controls - all of them have a DataContext and also an interface "you can drop on me".
    Further I have a Viewmodell (DC of the grid) which knows about these Items.

    My first approach (just to see how it works) resulted in a Grid where I can drag my items (I get a visual copy of them when dragging).
    -- By the way - by playing around I lost this (nice) ability to drag "my item" without the need to provide a template.

    Anyhow - I got stuck here.

    What I need (and hopefully can approach with DragDropManager)  is:
    Drag my Control within the bounds of my Grid
    Showing a "Disabled" when dragged outside of my Grid (app)
    Showing a "Disabled" when dragged over certain items (the container as well a the target can provide the "you can drop" information.
    And last not least - when dropped I need (of course) the dragged Item and the Item where the user dropped it on.

    No need for "List-Remove" or something like this - just X dropped on Y.

    Is DragDropManager usable for this approach or shall I better use WPF default D&D?
    The application is built on MVVM - so no code behind in the Control / Window would be nice.


  2. Nick
    Nick avatar
    593 posts

    Posted 26 Apr 2013 Link to this post

    Hi Manfred,

    Have you seen our RowReordering example(available in your local copy of our WPF examples)? I trust it covers the better part of your requirements, as to the not allowed drop when out of the control, you can use the DragLeave event and set the DragEffects to none to disable it. 

    Hope this helps! 

    All the best,
    Nikolay Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top