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

Get relative mouse coordinates while dragging items in ScheduleView

2 Answers 102 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Sandi Markon
Top achievements
Rank 1
Sandi Markon asked on 05 Jul 2012, 09:31 AM
Hello.

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 Answers, 1 is accepted

Sort by
0
Sandi Markon
Top achievements
Rank 1
answered on 06 Jul 2012, 09:11 AM
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 :)
0
Accepted
Konstantina
Telerik team
answered on 10 Jul 2012, 07:17 AM
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,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
ScheduleView
Asked by
Sandi Markon
Top achievements
Rank 1
Answers by
Sandi Markon
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or