Problem of PreviewDragEnded Event on RadTreeView

3 posts, 0 answers
  1. alino
    alino avatar
    22 posts
    Member since:
    Sep 2010

    Posted 07 Oct 2010 Link to this post

    Hi,

    I have a problem when I drag and drop my TreeViewItems in the TreeView. I use PreviewDragStarted and PreviewDragEnded event to manage my dropping. The PreviewDragStarted Work perfectely. But the problem is with PreviewDragEnded. The Event arises only  when I drop in any place in the the TreeView exept the same place.
    When i cancel the dragging or when I drop out of the TreeViw (for example in the other place of the main window) PreviewDragEnded doesn't arises. (For information IsDragPreviewEnabled, IsDragToolTipEnabled and IsLineEnabled are all set to true).

    Thank u for helping me to solve the problem.

    Alino
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 13 Oct 2010 Link to this post

    Hi alino,

    Sorry for the delayed reply. Dropping an item onto itself  or onto its father RadTreeViewItem or onto its children RadTreeViewitems (direct or not) is an invalid drop operation which does not fire  the RadTreeView.PreviewDragEnded event.  Therefore you cannot use the default RadTreeView drag and drop logic. You can use a DragAndDropManager and its events to implement adding a copy of the dragged RadTreeViewItem to the specific locations mentioned above. For the other drop locations you can handle the PreviewDragEnded event. Please find the attached solution which demonstrates such functionality and tell me if it satisfies your needs.


    I hope this is helpful for you. Feel free to ask if you need further assistance.

    Regards,
    Petar Mladenov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. alino
    alino avatar
    22 posts
    Member since:
    Sep 2010

    Posted 20 Oct 2010 Link to this post

    Hi Mladenov,

    Thank U very much for your advice. I have adapted your idea to my application and now i can easily catch the drag cancel and call my logic for that case.
    Best regards,

    Alino

Back to Top