DragLeave Event

8 posts, 1 answers
  1. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 26 May 2010 Link to this post

    Hi,

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

    Thanks
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 26 May 2010 Link to this post

    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.
  3. DevCraft banner
  4. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 27 May 2010 Link to this post

    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.
  5. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 02 Jun 2010 Link to this post

    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)
  6. MB
    MB avatar
    23 posts
    Member since:
    Aug 2007

    Posted 02 Jun 2010 Link to this post

    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? 
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 08 Jun 2010 Link to this post

    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.
  8. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 08 Jun 2010 Link to this post

    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.
  9. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 09 Jun 2010 Link to this post

    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.
Back to Top
DevCraft banner