
I was wondering, if it is possible to get the destination slot, when being in scope of the AppointmentEditing event handler? I realize that this event is fired, when an appointment is about be edited/resized/..., but I would still like to know what the new date span is going to be.
Thanks in advance.
4 Answers, 1 is accepted
You can't get the destination slot in the AppointmentEditing event. I will advice you to use AppointmentSaving event instead, where you can get the new Start/End of the Appointment and still Cancel the action on some condition.
If this event is not suitable for your scenario, please provide some more information and we will be glad to help.
Kind regards,
Boyan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

thanks
You can achieve this by attaching to AppointmentCreating event and then use the GettOccurences method. Here is some sample code that will Cancel the AppointmentCreating if there is already an Appointment in the time interval:
private
void
schedule_AppointmentCreating(
object
sender, AppointmentCreatingEventArgs e)
{
var appointments = scheduleView.AppointmentsSource
as
ObservableAppointmentCollection;
var allAppointments =
new
ObservableCollection<Occurrence>();
foreach
(var a
in
appointments)
{
allAppointments.AddRange(a.GetOccurrences(e.Appointment.Start, e.Appointment.End));
}
if
(allAppointments.Count>1)
{
e.Cancel=
true
;
}
}
Hope this helps.
Greetings,
Boyan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

private void sch_timesheet_AppointmentSaving(object sender, Telerik.Windows.Controls.AppointmentSavingEventArgs e)
{
ObservableCollection<MyAppointment> AllAppointments = sch_timesheet.AppointmentsSource as ObservableCollection<MyAppointment>;
e.Cancel = (
from a in AllAppointments where a.GetOccurrences(e.Appointment.Start, e.Appointment.End).Count > 0 && a.UniqueId != ((MyAppointment)e.Appointment).UniqueId select a).Count() > 0 ? true : false;
}
in AppointmentCreating or AppointmentEditing event you can not get the updated values of the returned appointment in AppointmentSavingEventArgs or AppointmentEditingEventArgs