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

Set start-date to mouse position when drag&drop between two schedule views

4 Answers 32 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Benedikt
Top achievements
Rank 1
Iron
Benedikt asked on 23 Apr 2021, 07:50 AM | edited on 28 Apr 2021, 01:24 PM

We have two instances of a rad-schedule view, both are displayed as timeline view. When the user drags an appointment from one scheduler and tries to drop the appointment into the other, the start date of the appointment is the same as in the drag-scheduler. Is it possible to set the start-date to the actual mouse-position?

I've tried to do this in our custom drag&drop behaviour, but it is not working.

EDIT

The problem in my cause occurred, because the first scheduler shows appoint that has a minimum duration of one day, the other one has a slot size of 15min. If I now start the drag&drop process by picking the appointment on the right side, it is very hard to point to the expected date and time. What I need is, that the dragged appointment always starts at the mouse cursor.

The black arrow is my mouse cursor, and I want to start the appointment at that position.

Thanks a lot!

4 Answers, 1 is accepted

Sort by
0
Benedikt
Top achievements
Rank 1
Iron
answered on 23 Apr 2021, 07:53 AM

As you can see here, the appointment is not starting at the mouse-position, but at a date in the past.

 

 

1
Dinko
Telerik team
answered on 28 Apr 2021, 07:27 AM

Hi Benedikt,

I am not sure that I was able to observe the described behavior. May I ask you to check the attached project and let me know what I am missing from your steps. When you run the project you can see one RadListBox and 2 RadScheduleViews. You can drag from RadListBox to the first RadScheduleView in TimelineView. Then you can drag-drop appointments from the top to the bottom RadScheduleView. Everything seems is correct regarding the start date.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Benedikt
Top achievements
Rank 1
Iron
commented on 28 Apr 2021, 01:25 PM

@Dinko thanks for your detailed reply, I've addedd some more details to the question.
1
Dinko
Telerik team
answered on 03 May 2021, 12:44 PM

Hi Benedikt,

I see what you mean here. I will need more time to check what will be the best option to modify the visual drop starting point. I will contact you again in the next couple of days.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

1
Accepted
Dinko
Telerik team
answered on 12 May 2021, 01:17 PM | edited on 13 May 2021, 01:28 PM

Hi Benedikt,

Thank you for your patience.

I have tried numerous ways but wasn't able to find a solution for this. Basically in the ScheduleViewDragDropBehavior.CanDrop() method you can get the current position of the drag visual from the DestinationSlots collection property from the event arguments. You can change the Start property of the Slot element inside the collection.

public override bool CanDrop(Telerik.Windows.Controls.DragDropState state)
{
    var destinationSlot = state.DestinationSlots.First() as Slot;
    destinationSlot.Start = myCustomDate;
    return base.CanDrop(state);
}

This will be the starting date. However, I couldn't find a way to get the position of the mouse over the RadScheduleView while dragging. When you start dragging the Mouse is over the drag visual. I am afraid that our RadScheduleView control does not provide an API to achieve this.

If you have any other questions, you can open a new thread with your questions inside.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ScheduleView
Asked by
Benedikt
Top achievements
Rank 1
Iron
Answers by
Benedikt
Top achievements
Rank 1
Iron
Dinko
Telerik team
Share this question
or