This is a migrated thread and some comments may be shown as answers.

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

2 Answers 29 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Gabriele Eigel
Top achievements
Rank 1
Gabriele Eigel asked on 27 Apr 2011, 03:03 PM
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 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 29 Apr 2011, 07:09 AM
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
0
Gabriele Eigel
Top achievements
Rank 1
answered on 29 Apr 2011, 09:28 AM
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
Tags
DragAndDrop
Asked by
Gabriele Eigel
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Gabriele Eigel
Top achievements
Rank 1
Share this question
or