radscheduler drag and drop within a day adjust times of appointment

679 views Asked by At

I have a radscheduler in month view on my asp page. Appointments are added by user but they just specify date.But NO time. So the added appointment could be anything.(12/9/2013 8am-9am).I am adding many appointments for that day.(example 5).Now user wants to drag the last one and drop it between the 2nd and 3rd appointment. This event should adjust the times accordingly for this appointment and also other appointments. How do i proceed?Any thoughts?

1

There are 1 answers

0
Omnivore On

It will be a manual bear but, here's my stab at your problem:

Get the new Start and End, for the dragged-and-dropped appointment. Then, using RadScheduler.Appointments.GetAppointmentsInRange(), check from the new StartTime down to the beginning of the day. With a little math, you should be able to figure out any conflicting appointment, before your dropped appointment.

Repeat the process for any conflicting appointment, on the other end with the new EndTime, for after the dropped appointment to the end of day.

You should be able to, then, adjust each appointment in appropriate order, bumping the previous down, if necessary, and the following up to make space for the new appointment. If necessary, repeat the process going down and then up the day, to bump other appointments.

You'll have to consider many points, such as "If the day is, practically, full already - where do I bump morning or afternoon appointments that are now out of the scope of the current day?" etc.

Hopefully this helps a little. It seems nothing has been all that simple with RadScheduler, once you leave the Telerik-given scope of functionality.