Skip to main content
A newer version of this page is available.

SchedulerControl.AdditionalAppointmentsDrag Event

Occurs for the appointments added to the AppointmentDragEventArgs.AdditionalAppointments collection when they are dragged with the primary appointment.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v19.1.dll


public event EventHandler<AdditionalAppointmentsDragEventArgs> AdditionalAppointmentsDrag

Event Data

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

Property Description
AdditionalAppointmentInfos Provides access to the properties of the additional dragged appointments.
PrimaryAppointmentInfos Provides access to the properties of the primary dragged appointments.


When an end-user drags an appointment, the SchedulerControl.AppointmentDrag event occurs for that appointment. Event data (the AppointmentDragEventArgs.AdditionalAppointments property) allows you to specify appointments which will be dragged with the primary appointment synchronously. When they are dragged, the AdditionalAppointmentsDrag event fires for each additional appointment. If an end-user presses ESC, both appointments return to the initial state.


private void SchedulerControl_AppointmentDrag(object sender, AppointmentDragEventArgs e) {
    // Find a special appointment among visible appointments.
    AppointmentBaseCollection visbileApts = schedulerControl1.ActiveView.GetAppointments();
    Appointment apt = visbileApts.Find(item => (item.Subject == "Finalize" && item.ResourceId.Equals(e.HitResource.Id)));
    if (apt == null) {
    else {
        if (e.SourceAppointment != apt) {
            // If the dragged appointment overlaps with the special appointment,
            // add the special appointment to the AdditionalAppointments collection
            // to drag along with the initial appointment.
            // The AdditionalAppointmentsDrag event will occur.
            if (e.EditedAppointment.End > apt.Start)

private void SchedulerControl1_AdditionalAppointmentsDrag(object sender, AdditionalAppointmentsDragEventArgs e) {
    if (e.AdditionalAppointmentInfos.Count <= 0)
    AppointmentDragInfo aptInfo = e.AdditionalAppointmentInfos[0];
    // If the end of the main dragged appointment becomes greater than the start of the special appointment,
    // set the start of the special appointment being dragged to the end of the main dragged appointment.
    // It prevents overlapping appointments.
    if (e.PrimaryAppointmentInfos[0].EditedAppointment.End > aptInfo.SourceAppointment.Start)
        aptInfo.EditedAppointment.Start = e.PrimaryAppointmentInfos[0].EditedAppointment.End;
See Also