Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SchedulerControl.DragAppointmentOver Event

Raised repeatedly while the user drags appointments within a Scheduler’s view.

Namespace: DevExpress.Xpf.Scheduling

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

NuGet Package: DevExpress.Wpf.Scheduling

#Declaration

public event DragAppointmentOverEventHandler DragAppointmentOver

#Event Data

The DragAppointmentOver event's data class is DevExpress.Xpf.Scheduling.DragAppointmentOverEventArgs.

#Remarks

The example below illustrates how to assign a specific label to appointments that intersect another appointment.

private void Scheduler_DragAppointmentOver(object sender, DragAppointmentOverEventArgs e) {
    //if a dragged appointment intersects another appointment, paint it red to indicate a conflict
   for (int i = 0; i < e.ConflictedAppointments.Count; i++)
      if (e.ConflictedAppointments[i].Count > 0)
         e.DragAppointments[i].LabelId = 1;
      //roll the label back if no conflicts are detected
   for (int j = 0; j < e.ConflictedAppointments.Count; j++)
      if (e.ConflictedAppointments[j].Count == 0)
         e.DragAppointments[j].LabelId = e.SourceAppointments[j].LabelId;
}
See Also