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

DragDropManager Prevent Drop, retain dropped item

3 Answers 106 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Justin Lee
Top achievements
Rank 1
Justin Lee asked on 28 Aug 2013, 06:04 PM

Hello,

I have 2 RadTreeViews.  Users can drag from Tree A to Tree B.  I had this working with RadDragAndDropManger, but an struggling to get it right with DragDropManager. 

I'm trying to do the following 2 things, using DragDropManager:

1. When the user drags an item from Tree A onto Tree B, do a check based on properties of the item whether the item can be dropped, and cancel the drop if needed.  (optionally, display as they are dragging that the item cannot be dropped in Tree B)

2. When an item is successfully dropped into Tree B, the item should still exist in Tree A.


Thanks,
Justin

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 02 Sep 2013, 11:37 AM
Hi Justin,

First you need to allow the RadTreeView to use the DragDropManager for the drag and drop logic. You can do this by setting the telerik:TreeViewSettings.DragDropExecutionMode property to New and the IsDragDropEnabled property to True.

Furthermore, you need to subscribe to some of the events of the DragDropManager and customize the default logic. In order to check if a drop operation is possible and update the drag visual you can subscribe to the DragOver event and TreeViewDragDropOptions.DropAction to None. You can find more information here.

Regarding, your second requirement you can take a look at this article where we described how you can achieve this behavior.

I hope this information is helpful.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Bernd
Top achievements
Rank 1
answered on 20 Dec 2013, 12:43 PM
Hi Pavel,

we've migrated from a 2012 Version directly to Q3 2013 Sp1 and - surprise - our drag 'n drop functionality did not work anymore. This hint (telerik:TreeViewSettings.DragDropExecutionMode and IsDragDropEnabled)
finally helped us - thank you.

Maybe a hint to those settings in the section "Changes and backwards compatibility" would have been helpfull. One could even go so far to consider this as a "breaking change" ... 

Best regards and a happy new year,
Bernd
0
Pavel R. Pavlov
Telerik team
answered on 25 Dec 2013, 09:29 AM
Hello Bernd,

Actually it is mentioned that the built-in DragDrop API is refactored. You can find it under the What's New section of the Q2 2013 release history.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
DragAndDrop
Asked by
Justin Lee
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Bernd
Top achievements
Rank 1
Share this question
or