This example handles the SchedulerControl.AllowAppointmentConflicts event to prevent appointments from crossing (when the user moves an appointment within the Scheduler). The SchedulerOptionsCustomization.AllowAppointmentConflicts property is set to AppointmentConflictsMode.Custom
to handle appointment conflicts manually.
The code in the AllowAppointmentConflicts
event handler checks whether the time interval of the modified appointment intersects with other appointments, including recurrent series and exceptions. If such an appointment is found, the appointment is added to the e.Conflicts
collection. If the collection has at least one element, a conflict occurs and the Scheduler control cancels changes.
The example also handles the CustomDrawAppointmentBackground event to highlight conflicts. The AppointmentConflictsCalculator.CalculateConflicts method is used to obtain appointment conflicts.