SchedulerControl.CustomAllowAppointmentConflicts Event

Occurs when a Scheduler appointment has been edited and allows you to define whether conflicts are present.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v21.2.dll


public event AppointmentItemConflictEventHandler CustomAllowAppointmentConflicts

Event Data

The CustomAllowAppointmentConflicts event's data class is AppointmentItemConflictEventArgs. The following properties provide information specific to this event:

Property Description
Appointment Gets the appointment for which the element is raised. Inherited from AppointmentItemEventArgs.
AppointmentClone Gets the clone of the appointment being processed.
Conflicts Gets the collection of appointments which are considered to be conflicting with the current appointment.
Interval Retrieves the time interval for which the event was raised.

The event data class exposes the following methods:

Method Description
RemoveConflictsWithDifferentResource(IList<AppointmentItem>, Object) Removes all the conflicting appointments from the specified collection whose SchedulerItemBase.ResourceId doesn’t match the specified Id.


Handle the CustomAllowAppointmentConflicts event to manually define whether the current appointment conflicts with any other appointments. If you do not specify the required behavior manually, the SchedulerControl.AllowAppointmentConflicts property manages whether the time interval of two or more appointments can intersect.

Access the appointment’s copy using the AppointmentItemConflictEventArgs.AppointmentClone property.

Clear the AppointmentItemConflictEventArgs.Conflicts collection in this event handler if you determine that the current appointment has no conflicts. The non-empty Conflicts collection cancels the user’s action that caused a conflict. The common practice is to clear the Conflicts collection at the beginning, and populate it with any appointment if the user’s action should be canceled. You can even create a fake appointment for this purpose and add it to the collection.

The source appointment (accessed using the AppointmentEventArgs.Appointment property) or its copy isn’t considered to be conflicting if it’s present in the Conflicts collection. There should be other appointments in this collection to indicate the conflict.


View Example

private void schedulerControl1_CustomAllowAppointmentConflicts(object sender, AppointmentItemConflictEventArgs e)
    //Obtain the selected interval:
    TimeInterval interval = e.Interval;

    //If the appointment is to be moved to the restricted time interval, 
    //Add the dragged appointment the conflicting appointments collection: 
    if (!IsIntervalAllowed(interval))
See Also