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

DragDropManager migration and access to destination element problem

1 Answer 51 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Krzysztof
Top achievements
Rank 1
Krzysztof asked on 14 Mar 2014, 12:04 PM
Hi,

I'm migrate RadDragAndDropManager to new DragDropManager and i have a problem with access to destination element.

When i using RadDragAndDropManager i check in DragQuery if destination element (RadTreeViewItem) contains dragged item and change DragDropQueryEventArgs.QueryResult.

How can i replace DragDropQueryEventArgs.Options.Destination in new DragDropManager? Or tell me how to implement condition on destination element using new DragDropManager.

Thanks in advance,
Kris

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 18 Mar 2014, 02:18 PM
Hi Krzysztof,

In order to achieve the desired scenario you will need to handle the DragOver of the target element where you can check the Item is present. And if you need to prevent the drop if the item is present you will need to set the e.Effects to DragDropEffects.None and to handle the GiveFeedback method of the first element. Inside of the handler you would need to check the e.Effects are none in order to set the cursor to Cursors.None. For your convenience I have prepared a sample project which demonstrates the exact approach with two ListBoxes.

Hope this helps. If you have any further questions let us know.

Regards,
Kalin
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
DragAndDrop
Asked by
Krzysztof
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or