How to find out that the dropable area is left...

3 posts, 0 answers
  1. Gabriele Eigel
    Gabriele Eigel avatar
    9 posts
    Member since:
    Jan 2009

    Posted 27 Apr 2011 Link to this post

    Hi,

    in my project I have a RadTreeView with drag and drop capabilities (realized with RadDragAndDropManager)  and I would like to know (during a drag and drop operation) if the mouse left the dropable area. How? The MouseLeave event on the tree control it seems not to work if I am in drag mode.... Do you have any suggestion?

    Thank you in advance,
       Gabriele
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 29 Apr 2011 Link to this post

    Hi Gabriele Eigel,

    If you want to know when the mouse has left the dropable area, you should use RadDragAndDropManager.DragInfoEvent. For example:

    RadTreeView1.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(RadTreeView1OnDragInfo));

     private void RadTreeView1OnDragInfo(object sender, DragDropEventArgs e)
            {
                TreeViewDragCue cue = e.Options.DragCue as TreeViewDragCue;
                if (e.Options.Status == DragStatus.DropImpossible)
                {
                    cue.DragActionContent = String.Format("no way!");
                }
            }

    You can as well check the e.Options.Destination object. Is it null, or is it some specific object?

    When you are dragging with drag and drop manager, the mouse events are not fired, that is why you cannot use them.

    I hope that this information will help you to implement your logic.


    Greetings,
    Didie
    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. Gabriele Eigel
    Gabriele Eigel avatar
    9 posts
    Member since:
    Jan 2009

    Posted 29 Apr 2011 Link to this post

    Hi Didie,

    thank you for your posting, it works fine. I already hat a DragInfo event handler but I didn't has the idea to check the e.Option.Status on Drop Impossible :-).

    Thank you a lot,
       Gabriella
Back to Top