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

DragLeave Event

7 Answers 103 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Phillip Garrett
Top achievements
Rank 1
Phillip Garrett asked on 26 May 2010, 05:10 PM
Hi,

Is there an event to detect the users drag leaving a control in the RadDragAndDropManager? or another way of detecting this?

Thanks

7 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 26 May 2010, 06:04 PM
Hi Phillip Garrett,

You can sign up for the RadDragAndDropManager.DropInfo event and check the

e.Options.Status == Status.DropImpossible

When a valid payload is accepted for an object the a DropInfo event with status DropPossible is raised. When the mouse leaves the object the same event with status 'DropImpossible' is raised.

Here is an article with more information about the different events:

http://www.telerik.com/help/silverlight/raddragdrop-events-eventargs.html

Hopefully this will work for you.

Regards,
Miroslav
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
Phillip Garrett
Top achievements
Rank 1
answered on 27 May 2010, 04:31 PM
Thanks Miroslav,

Unfortunately my scenario is rather complicated as the controls which I wish to handle a drag leave event sit inside a control which I also allow dropping onto.

Thus the DropImpossible event will never be fired as i'm allowing a drop in most mouse positions.

I've ended up handling what should be a drag leave event in the drag possible event of the larger control that the smaller controls sit inside.
0
Phillip Garrett
Top achievements
Rank 1
answered on 02 Jun 2010, 06:17 PM
Hi,

After a bit more trial and error - I can see you were correct to test for the DropImpossible status.

However I've come across some strange behaviour. Like I say above - my situation is that I have smaller controls inside a larger control. I want to detect when i'm in these controls and when i'm not.

The issue i'm having is when I move between a smaller control and the larger control. I was expecting for the DragInfo event handler to continually return a DropPossible status as both controls AllowDrop. But inbetween these control I get a DropImpossible fired. Is this coming from the one of the controls as I leave it?

Is there a way to suppress/ignore the DropImpossible when moving between two controls in the DragInfo? (but still detect when i'm not over any control)
0
MB
Top achievements
Rank 1
answered on 02 Jun 2010, 10:30 PM
Miroslav,

I had a similar question.  I have handled DropImpossible and that works well.  However:

"When a valid payload is accepted for an object the a DropInfo event with status DropPossible is raised. When the mouse leaves the object the same event with status 'DropImpossible' is raised"

I NEED DropImpossible or some event to fire in the scenario that an invalid drop zone is crossed as well.
We are changing the view state of the object when it is an invalid drop zone.  However when the user drags of the object it should restore to normal view state.  This works fine for a valid drop zone (as DropImpossible event occurs) but not for an invalid zone (where QueryResult == false initially) as there is no event that fires at all to tell the user is leaving the zone.

I tried to use the object MouseLeave but it does not even fire (I guess b/c mouse is focused on dragging object?)

Hope this is clear.  Thoughts? 
0
Tina Stancheva
Telerik team
answered on 08 Jun 2010, 02:18 PM
Hi guys,

Please accept my apology for the delayed response.

I prepared a sample project illustrating how to change the DragCue depending on whether a drop is possible or not. Mark, can you please take a look at the attached sample project and let me know if this is what you had in mind?

Phillip, you cannot suppress the DropImpossible status in the Drag/DropInfo event handlers but if you can elaborate on your scenario a bit more, we will be able to suggest a better approach.

Sincerely yours,
Tina Stancheva
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
Accepted
Tina Stancheva
Telerik team
answered on 08 Jun 2010, 02:18 PM
Hi guys,

Please accept my apology for the delayed response.

I prepared a sample project illustrating how to change the DragCue depending on whether a drop is possible or not. Mark, can you please take a look at the attached sample project and let me know if this is what you had in mind?

Phillip, you cannot suppress the DropImpossible status in the Drag/DropInfo event handlers but if you can elaborate on your scenario a bit more, we will be able to suggest a better approach.

Sincerely yours,
Tina Stancheva
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
Phillip Garrett
Top achievements
Rank 1
answered on 09 Jun 2010, 09:47 AM
I have solved my problem. I put tests in when handeling a DropImpossible event to test for my specific senario and ignore. Its not elegant but seems to work ok.
Drag&Drop was probably desgined (and intended) for controls that do not overlap and are graphically separate.
Thanks for your help.
Tags
DragAndDrop
Asked by
Phillip Garrett
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Phillip Garrett
Top achievements
Rank 1
MB
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or