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

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:

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