DragDropManager drop without removing dragged object from tree

4 posts, 0 answers
  1. Matus
    Matus avatar
    5 posts
    Member since:
    Sep 2014

    Posted 11 Sep 2014 Link to this post

    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..).
  2. Matus
    Matus avatar
    5 posts
    Member since:
    Sep 2014

    Posted 11 Sep 2014 Link to this post

    Uhm, and if possible, could you move this thread to UI for Silverlight?
  3. DevCraft banner
  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 16 Sep 2014 Link to this post

    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.
     
  5. Matus
    Matus avatar
    5 posts
    Member since:
    Sep 2014

    Posted 16 Sep 2014 in reply to Pavel R. Pavlov Link to this post

    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
Back to Top