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

Simple Basic D&D

1 Answer 79 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 25 Apr 2013, 09:03 PM
Hi,

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.

Thanks
Manfred

1 Answer, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 26 Apr 2013, 09:23 AM
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.

Tags
DragAndDrop
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Nick
Telerik team
Share this question
or