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() Constructor

In This Article

Initializes a new instance of the SchedulerControl class with default settings.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#Declaration

public SchedulerControl()

#Example

The following example adds a SchedulerControl to a form.

Design Time

Drag the SchedulerControl item from the toolbox to the form.

Note

If the form already contains a SchedulerDataStorage object, it is assigned to the SchedulerControl.DataStorage property. Otherwise, the form adds a new SchedulerDataStorage and assigns it to the SchedulerControl.

Runtime

To add a SchedulerControl to a form at runtime, add references to assemblies listed in the Deployment document. Create SchedulerControl and SchedulerDataStorage instances using default constructors, assign the SchedulerDataStorage to the SchedulerControl.DataStorage property, and adjust control settings as required.

Important

When you create a SchedulerControl in code, wrap all code that modifies control settings in BeginInit() and EndInit() method calls. Otherwise, the control may try to apply these settings before it is fully initialized, which may cause performance issues and errors.

SchedulerControl scheduler = new SchedulerControl();
SchedulerDataStorage storage = new SchedulerDataStorage();

scheduler.BeginInit();
scheduler.Dock = DockStyle.Fill;
scheduler.ActiveViewType = SchedulerViewType.WorkWeek;

storage.AppointmentDependencies.AutoReload = false;
storage.Appointments.AutoReload = false;
storage.Resources.AutoReload = false;

scheduler.DataStorage = storage;
scheduler.EndInit();
form1.Controls.Add(scheduler);
See Also