Skip to main content

SchedulerControl() Constructor

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

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v23.2.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public SchedulerControl()

Example

The following example demonstrates how to add the SchedulerControl to a form. Note that the Scheduler Control can be added to your scheduling application at both design-time and runtime.

  • Design time.

    By default, the SchedulerControl item is located in the DX.23.2:Scheduling toolbox tab of the Visual Studio IDE. So, to add the Scheduler Control to your project, simply drag the corresponding toolbox item, and drop it onto the form.

    Lesson1_DropScheduler

    Note

    If the form already contains the SchedulerDataStorage object, then it will be assigned to the SchedulerControl.Storage property. Otherwise, the new Scheduler Storage will be automatically added to the form, and then assigned to the Scheduler Control.

  • Runtime.

    To add a Scheduler Control to a form at runtime, add references to the assemblies listed in the Deployment document. Subsequently create the SchedulerControl and the SchedulerStorage instances using default constructors, set the SchedulerControl.Storage property of the scheduler control and adjust control settings as required.

    Important

    When you create a Scheduler Control in code, place all code that modifies control settings between the 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