Capture event when appointment changed by mouse (by resizing or dragging)

How can I capture event when user change appointment interval by resizing or dragging with mouse. I want to save appointment status/state automatically each time user finalize changing. I'm trying to update appointment details in SQL every time when user change something about an appointment.

Thank you.

3 Replies

AR Arulpriya Ramalingam Syncfusion Team December 20, 2017 10:26 AM UTC

Hi Constantin,  
  
Thanks for contacting Syncfusion support.  
  
The AdjustingAppointmentWithMouse event will be triggered whenever the time of an appointment is modified by resizing the appointment. As per your requirement, we would suggest you to use the AdjustingAppointmentWithMouse event to notify the action when the time interval of an appointment is modified. Please make use of below code,  
  
Code example  
  
//Event triggering  
this.scheduleControl1.AdjustingAppointmentWithMouse += ScheduleControl1_AdjustingAppointmentWithMouse;  
  
//Event customization  
private void ScheduleControl1_AdjustingAppointmentWithMouse(object sender,AdjustingAppointmentMouseWithEventArgs e)  
{  
    //your code for customization.  
}  
  
Please let us know if you have any other queries.  
  
Regards,  
Arulpriya  



CB CONSTANTIN BOGDAN December 20, 2017 11:54 AM UTC

Thank you.

Pretty nice but I can't use it. I have to know when changing is finished because I have to read the final values of modified appointment and then to write desire values to SQL. Do you have any suggestion regard this issue?

Later Edit: ItemChanged event should be a solution but is not rising in this context.


AR Arulpriya Ramalingam Syncfusion Team December 21, 2017 12:42 PM UTC

Hi Constantin, 
 
Thanks for your update. 
 
We could understand your requirement. The ItemChanging event of ScheduleControl will be triggered whenever the appointment values are modified. As per your requirement, the item can be retrieved by checking for the Action by using the ProposedItem property. Please make use of below code, 
 
Code example 
 
//Event triggering 
this.scheduleControl1.ItemChanging += ScheduleControl1_ItemChanging; 
 
//Event customization 
private void ScheduleControl1_ItemChanging(object sender, ScheduleAppointmentCancelEventArgs e) 
{ 
    if(e.Action == ItemAction.TimeDrag || e.Action == ItemAction.ItemDrag) 
    { 
        //To retrieve start and end time of the appointment 
        DateTime startDate = e.ProposedItem.StartTime; 
        DateTime endTime = e.ProposedItem.EndTime; 
    } 
} 
 
Please let us know if you have any other queries. 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon