We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Resize set Increment on resize

Hello,

is possible to set the increment time when resize or drag/drop appointment on the calendar, exemple (00, 15, 30, 45) ?

1 Reply

VR Vigneshkumar Ramasamy Syncfusion Team April 19, 2016 10:07 AM UTC

Dear Customer,

Thanks for using Syncfusion product.

As of now your requirement of setting increment time when resize the appointment in schedule can be achieved by using AppointmentEndResizing event in the schedule control. We have prepare sample for the same and please find the sample in the below link.

Sample link: Schedule_Resize

Note: In the above sample we have used resize event to set the increment time when resize the appointment. In the same way, you can also achieve your requirement for drag and drop the appointment by using AppointmentEndDragging event in the schedule control.

In the above sample we have used below code snippet to set the time when resize the appointment.

 
 
private void Schedule_AppointmentEndResizing(object sender, AppointmentEndResizingEventArgs e)

        {

            if(e.To.Minute<15)

            {

                (e.Appointment as ScheduleAppointment).EndTime = e.To.AddMinutes(15 - e.To.Minute);

            }

            else if (e.To.Minute> 15 && e.To.Minute <30)

            {

                (e.Appointment as ScheduleAppointment).EndTime = e.To.AddMinutes(30 - e.To.Minute);

            }

           else if(e.To.Minute>30 && e.To.Minute<45)

            {

                (e.Appointment as ScheduleAppointment).EndTime = e.To.AddMinutes(45-e.To.Minute);

            }

           else if(e.To.Minute>45)

            {

                (e.Appointment as ScheduleAppointment).EndTime = e.To.AddMinutes(60 - e.To.Minute);

            }

            e.Cancel = true;

        }


In the above code snippet, based on the value of e.To, we have modified the appointment end time and also we have used e.Cancel = true to stop the default actions of AppointmentEndResizing event.

Regards

Vigneshkumar R


Loader.
Live Chat Icon For mobile
Up arrow icon