windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-dot-ctor-d29124f3.md
Initializes a new instance of the SchedulerControl class with default settings.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public SchedulerControl()
Public Sub New
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);
Dim scheduler As New SchedulerControl()
Dim storage As 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