5 Answers, 1 is accepted
You can handle the onClientAppointmentMoveStart and set the desired start and end time as it is set to 13-th of April in the code bellow:
function
OnClientAppointmentMoveStart(sender, args) {
var
start =
new
Date(2012, 3, 13, 11, 33, 0);
var
oneHourLater =
new
Date(2012, 3, 13, 12, 33, 0);
args.get_appointment().set_start(start);
args.get_appointment().set_end(oneHourLater);
sender.updateAppointment(args.get_appointment());
args.set_cancel(
true
);
}
Hope this will be helpful.
All the best,
Plamen Zdravkov
the Telerik team

function
OnClientAppointmentMoveEnd(sender, eventArgs) {
var
apt = eventArgs.get_appointment();
//alert(apt._start);
var
oldstart = apt._start;
var
oldend = apt._end;
var
newstart = eventArgs.get_newStartTime();
//var newstart = eventArgs.get_newStartTime();
eventArgs.get_appointment().set_start(newstart);
eventArgs.get_appointment().set_end(oldend);
sender.updateAppointment(eventArgs.get_appointment());
eventArgs.set_cancel(
true
);
}
I have inspected the code that you pasted. It seems that you are trying to change only the start of the dragged appointment and persist the "old End". This was working properly at my side in all case without those when the start time was set to be greater than the end time which is forbidden and is an expected error. Here is the code that I added in order to prevent the error:
function
OnClientAppointmentMoveEnd(sender, eventArgs) {
var
apt = eventArgs.get_appointment();
//alert(apt._start);
var
oldstart = apt._start;
var
oldend = apt._end;
var
newstart = eventArgs.get_newStartTime();
//var newstart = eventArgs.get_newStartTime();
eventArgs.get_appointment().set_start(newstart);
if
(newstart < oldend) {
eventArgs.get_appointment().set_end(oldend);
sender.updateAppointment(eventArgs.get_appointment());
eventArgs.set_cancel(
true
);
}
}
Here you can see a video of my test as well.
Hope this will be helpful.
Greetings,
Plamen
the Telerik team

This unusual behavior is most probably caused because you have not handled update event and this causes the appointments to reload instead of changing their start and end time.
I am attaching a sample project that shows how should you bind a RadScheduler to ObjectDataSource in order to have a working drag and drop functionality.
Hope this will be helpful.
Plamen
the Telerik team