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 Class

Displays scheduled data using one of the available views and provides the capability to edit, save and load appointments. See Scheduler.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#Declaration

[ComVisible(false)]
public class SchedulerControl :
    Control,
    IGestureClient,
    IMouseWheelScrollClient,
    IMouseWheelSupport,
    ISupportLookAndFeel,
    ISupportInitialize,
    IToolTipControlClient,
    IBatchUpdateable,
    IBatchUpdateHandler,
    IDXManagerPopupMenu,
    IPrintable,
    IBasePrintable,
    IXtraSerializable,
    IXtraSerializableLayout,
    IXtraSerializableLayout2,
    IXtraSerializableLayoutEx,
    IInnerSchedulerControlOwner,
    ICommandAwareControl<SchedulerCommandId>,
    ISupportAppointmentEdit,
    ISupportAppointmentFlyout,
    ISupportAppointmentDependencyEdit,
    IServiceContainer,
    IServiceProvider,
    ISupportCustomDraw,
    ISchedulerCommandTarget,
    IInnerSchedulerCommandTarget,
    ISupportXtraSerializer,
    IRangeControlClient,
    IRangeControlAccessibleClient,
    IRangeControlClientPainter,
    IContextItemCollectionOptionsOwner,
    IContextItemCollectionOwner,
    ISupportsSmartFetch,
    IContextItemProvider,
    ITimeZoneHost,
    IDirectXClient,
    ISupportDXSkinColors,
    ISupportCustomAppointmentLayout,
    IScaleDpiProvider,
    IFinalLayoutValidatable

#Remarks

The SchedulerControl class is a visual control that allows Appointments to be scheduled and displayed. Appointments can be shown using one of the Views provided by the scheduler control. A View is an object that defines the timeline and the layout of the appointments along the timeline. For instance, the DayView represents appointments by day. When this View is active, the scheduler control displays a single day at a time with the appointments that are assigned to this day. All the scheduler Views descend from the SchedulerViewBase class.

To select a specific View, use the SchedulerControl.ActiveViewType property. View settings can be accessed via the SchedulerControl.Views property.

The XtraScheduler control does not store appointments and appointment resources it displays. The control’s data is stored in a standalone SchedulerDataStorage class instance. This storage should be assigned to the SchedulerControl.DataStorage property. When a scheduler control is added to a form at design time, a new SchedulerDataStorage object is automatically created and assigned to the SchedulerControl.DataStorage property. When a scheduler control is created at runtime, the storage must be created and assigned to the control manually.

#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);

#Implements

#Inheritance

See Also