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 Programmatically add an empty Event and Invoke the Event Editor for it

In order to create an empty user event in code, use the TcxSchedulerControlEvent‘s overloaded constructor that takes a scheduler’s storage instance as an argument. Using this overload allows you to bind a user event created programmatically to storage.

After the new user event has been created, use the scheduler’s EditEventUsingDialog method to invoke the Event editor, so an end-user can complete scheduling for it.

Delphi
// ...
var
  AEvent: TcxSchedulerControlEvent;
begin
  AEvent := TcxSchedulerControlEvent.Create(cxSchedulerStorage1);
  try
    AEvent.Caption := 'Created in code';
    // invoke the Event editor for the created event
    cxScheduler1.EditEventUsingDialog(AEvent);
  finally
    FreeAndNil(AEvent);
  end;
end;

The following image shows the result:

See Also