Skip to main content

How to Prevent more than one Event from being dragged at a Time

A scheduler’s OnBeforeDragEvent event makes it easy to implement this feature.

Within the event handler, use the scheduler’s SelectedEventCount property to determine whether two or more user events are about to be dragged, and if a multiple selection has been performed, set the Allow parameter to False to prevent user events from being dragged simultaneously.

The following example demonstrates how to do this:

// ...
procedure TForm1.cxScheduler1BeforeDragEvent(Sender: TcxCustomScheduler;
  AEvent: TcxSchedulerControlEvent; X, Y: Integer; var Allow: Boolean);
begin
  Allow := Sender.SelectedEventCount = 1;
end;
See Also