How to change an appointment property during runtime
Environment
Product | RadScheduleView for WPF |
Description
How to update an appointment when it is in the AppointmentSource of the RadScheduleView.
Solution
There are two possible approaches:
Calling the BeginEdit method of RadScheduleView before editing and the Commit method after the properties of the appointment are changed.
Example 1: Updating an appointment via BeginEdit and Commit
this.scheduleView.BeginEdit(appointment);
appointment.Start = appointment.Start.AddHours(1);
appointment.End = appointment.End.AddHours(1);
this.scheduleView.Commit();
Example 2: Updating an appointment via Remove and Add
this.source.Remove(appointment);
appointment.Start = appointment.Start.AddHours(1);
appointment.End = appointment.End.AddHours(1);
this.source.Add(appointment);