Skip to main content

How to Bind Multiple Scheduler Storages to a Scheduler at Design-Time

  • 2 minutes to read

The following example demonstrates how to bind the TcxSchedulerDBStorage and TcxSchedulerStorage to the scheduler, using the TcxSchedulerAggregateStorage component, at design-time.

Follow the steps below:

  1. Drop the TcxScheduler control, the TcxSchedulerDBStorage , TcxSchedulerStorage , and TcxSchedulerAggregateStorage components onto a form from the Component Palette‘s DevExpress page.

  2. Configure the TcxSchedulerDBStorage and TcxSchedulerStorage components. To learn how to prepare scheduler storages for use in a scheduling application, refer to the Bound Mode and Unbound Mode help topics.

  3. Select the TcxSchedulerAggregateStorage component. In the Object Inspector, click the ellipsis button next to the TcxSchedulerAggregateStorage.Links property to open the collection editor.

  1. Using the collection editor, create two links (TcxSchedulerStorageLink instances) and bind the TcxSchedulerDBStorage and TcxSchedulerStorage to each link using the TcxSchedulerStorageLink.Storage property. Specify which scheduler storage will be the common storage in the application (this is the storage to which the scheduler will submit the data by default). To do this, set the TcxSchedulerStorageLink.Default property to True.

  1. Select the TcxScheduler control. In the Object Inspector, bind the TcxSchedulerAggregateStorage to the scheduler using the scheduler’s Storage property.

  1. Handle the TcxSchedulerAggregateStorage.OnEventInserting event to provide a data flow control for scheduler storages, as shown in the following example:
// ...
procedure TForm1.AggregateStorageEventInserting(
  Sender: TcxSchedulerAggregateStorage; AEvent: TcxSchedulerEvent;
  var AStorage: TcxCustomSchedulerStorage);
begin
  // submit all-day events to unbound storage (this storage is not default)
  if AEvent.AllDayEvent then
    AStorage := SchedulerStorage;
end;
See Also