Get relative mouse coordinates while dragging items in ScheduleView

3 posts, 1 answers
  1. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 05 Jul 2012 Link to this post


    I'm currently working with the drag & drop functionality for the ScheduleView control.
    I use my own impementation of the ScheduleViewDragDropBehavior, in which i override the methods, needed for my scenarios.

    For some time now, I've been struggling with getting the mouse position, relative to the ScheduleView control, when I drag items over it. My first attempt was to add a mouse move handler to the RootVisual property, but I noticed that, when a drag is in progress, the event handler never gets called (only the CanDrop method does). So I basically cannot get the last mouse movement when a drag operation is in progress.

    The reason I need this functionality is that the items, that are being dragged, are added to existing appointments (these appointments are custom implementations of the IAppointment interface and have an added property, which is a collection of items that I'm dragging). The problem arises, when appointments are overlapping, so I cannot know onto which appointment the user wants to drop the payload.

    Could there be any solution to this?
    Any help would be more than moreso greatly appreciated. Thanks.
  2. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 06 Jul 2012 Link to this post

    I somehow managed to get around the issue by adding a DragOver handler to the RootVisual property in my custom drag & drop behavior class. This way, I can access the current mouse position. But I doesn't feel quite right :)
  3. Answer
    Konstantina avatar
    2332 posts

    Posted 10 Jul 2012 Link to this post

    Hi Sandi,

    This is the exact way this should be achieved - the DragOver handler contains the information about the mouse position relative to the ScheduleView.

    All the best,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top