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

DragDropManager drop without removing dragged object from tree

3 Answers 77 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Matus
Top achievements
Rank 1
Matus asked on 11 Sep 2014, 11:42 AM
Hello,
I have an application with RadTreeView with usage of DragDropManager, we have recently migrated from RadDragDropManager.
With RadDragDropManager the drop event(RadDragAndDropManager.DropInfoEvent with DragStatus = DropComplete) did not remove the dragged item from the tree and we relied on this in our app logic. Changing this would be a pain.
The DragDropManager on the other hand removes the item, regardless of the DragEventArgs.Effects value, except when the effects are set to None - but in such case the OnDrop handler is not called.
What I need, is to
- intercept the Drop event (or maybe DragDropCompleted event),
- get both the target tree item and dragged data
- the dragged item is not removed from the tree
Additionaly, we are still on silverlight 4, therefore we cannot use features later than those in telerik radcontrols 2012 q2.

According to solution proposed here, setting the TreeViewDragDropOptions.DropAction would solve this, but I am afraid the type TreeViewDragDropOptions is not present in telerik 2012 q2.
Using a DragDropCompletedHandler instead of DropHandler (with Effects = None) prevents the dragged item from being removed, but I cannot find a way to determine the target item.
What is the best solution (workaround where I remember the target item separately or using the old RadDragDropManager instead etc..).

3 Answers, 1 is accepted

Sort by
0
Matus
Top achievements
Rank 1
answered on 11 Sep 2014, 01:28 PM
Uhm, and if possible, could you move this thread to UI for Silverlight?
0
Pavel R. Pavlov
Telerik team
answered on 16 Sep 2014, 06:06 AM
Hi Matus,

With the improved DragDropManager, the only way to copy the dragged item, instead of moving it, is to use the DropAction property. Since you are not able to upgrade to our latest official release, it would be better for you to use the obsolete RadDragAndDropManager and the events that you are used to, instead of the improved DragDropManager. This can be achieved by setting the DragDropExecutionMode to Legacy.

<telerik:RadTreeView telerik:TreeViewSettings.DragDropExecutionMode="Legacy" .../>
Please note that we always recommend using our latest official releases with our latest fixes and features, but in your specific case you are not able to use our latest binaries due to Silverlight 4. This is why I suggested using an obsolete property.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Matus
Top achievements
Rank 1
answered on 16 Sep 2014, 07:38 AM
Hi Pavel,
thanks for your reply. It doesn't make me exactly happy, but we have one more reason to move to silverlight 5 :)
Regards
Matus
Tags
TreeView
Asked by
Matus
Top achievements
Rank 1
Answers by
Matus
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or