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

During Drag-and-drop -- how to enable Copy through pressing Ctrl?

5 Answers 127 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 07 Aug 2013, 06:53 AM
Hi telerik,

Using the old implementation of drag-and-drop, we were able to copy-drag by catching the press of Ctrl key during the drag.

How do you recommend enabling this functionality using the new dragdropmanager?

Yours,

Anders, Denmark

5 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 11 Aug 2013, 08:04 AM
Hi Anders,

In order to achieve your requirements you can subscribe to the DragOver event of the RadTreeView control. In its handler you will be able to access the TreeViewDragDropOptions.DropAction property and set it to Copy if the Ctrl key is pressed.

Furthermore, in the handler of the Drop event you will be able to check the DropAction property and implement your custom drop logic depending on it. For reference you can take a look at this article.

Please give it a try and let us know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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
Anders
Top achievements
Rank 1
answered on 12 Aug 2013, 09:42 AM
Hi,

We've moved to the new dragdropmanager and thought that was the way forward. If need be, we'll have to combine with treeview events. Is there a plan for moving the rest of the drag handling to the dragdropmanager?

Anders, Denmark
0
Pavel R. Pavlov
Telerik team
answered on 14 Aug 2013, 11:28 AM
Hi Anders,

The migration from the obsolete RadDragAndDrop managed to the new DragDropManager is already completed and for the moment we do not plan to do any more refactoring of the drag&drop logic.

Can you please clarify what you mean when you say "moving the rest of the drag handling to the dragdropmanager"? What is the functionality that can not be achieved with the current implementation?

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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
Anders
Top achievements
Rank 1
answered on 16 Aug 2013, 07:49 AM
"Can you please clarify what you mean when you say "moving the rest of the drag handling to the dragdropmanager"? What is the functionality that can not be achieved with the current implementation?"

Yes, to me it's a strange mix, that DragDropManager is introduced and that events are handled through that -- but we still need to use events on the treeview. It's a matter of taste of course, but I would have though, that if events can be handled through DragDropManager, then all needed behavior can be handled there. I'm thinking, why use the DragDropManager at all, why not just map all the events to the treeview if we need it anyway?!
0
Hristo
Telerik team
answered on 21 Aug 2013, 08:17 AM
Hi Anders,

I am sorry for the caused misunderstanding. Basically there is no need to handle TreeView drag drop events when using DragDropManager. You could use just DragDropManager events. Actually TreeView internally listens to same those DragDropManager events and executes its own built-in logic.

We decided TreeView does not need own drag drop events because they would cause only confusion and would be better to attach handlers to the common DragDropManager events. So we did not introduced new drag drop events owner by the TreeView.
However, TreeView has some drag drop events inherited from its legacy drag drop implementation using obsolete RadDragAndDropManager. This event will be marked with obsolete tag and removed later on.

Hope I have managed to shed some light over the topic. Please let us know if you need more info.

Regards,
Hristo
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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
TreeView
Asked by
Anders
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Anders
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or