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
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.
Pavel R. Pavlov
Telerik
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 >>
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
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
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 >>
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?!
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.
Hristo
Telerik
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 >>