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

6 posts, 0 answers
  1. Anders
    Anders avatar
    80 posts
    Member since:
    Dec 2010

    Posted 07 Aug 2013 Link to this post

    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
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 11 Aug 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anders
    Anders avatar
    80 posts
    Member since:
    Dec 2010

    Posted 12 Aug 2013 Link to this post

    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
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 14 Aug 2013 Link to this post

    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 >>
  6. Anders
    Anders avatar
    80 posts
    Member since:
    Dec 2010

    Posted 16 Aug 2013 Link to this post

    "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?!
  7. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 21 Aug 2013 Link to this post

    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready