Move an appointment in RadScheduleView

1 Answer 49 Views
DragAndDrop ScheduleView
Egbert
Top achievements
Rank 1
Iron
Egbert asked on 11 Sep 2024, 06:12 AM

Hi,

How can I detect if an appoint is moved?

Which event is being fired and how can I implement this in the ViewModel and View?

Thanks...

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 13 Sep 2024, 08:01 AM

Hello Egbert,

When an appointment is moved, the AppointmentEdited is raised. However, the event will be invoked whnever the appointment is changed - for example, when you resize it or modify it via the edit dialog. You can link the event to a command in the model, using the EventToCommandBehavior.

If you want to listen specifically for appointment moving that happens via drag/drop, you can implement a custom drag/drop behavior and execute a command in the Drop method override. This will allow you to bind the drop (moved) action to a command in your view model.

 public class CustomScheduleViewDragDropBehavior : ScheduleViewDragDropBehavior
 {
     public ICommand DropCommand { get; set; }

     public override void Drop(DragDropState state)
     {
         base.Drop(state);
         if (DropCommand != null)
         {
             DropCommand.Execute(null);
         }
     }
 }

Regards,
Martin Ivanov
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
DragAndDrop ScheduleView
Asked by
Egbert
Top achievements
Rank 1
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or