Back to Devexpress

How to: Programmatically Change the Active View

windowsforms-2272-controls-and-libraries-scheduler-examples-layout-how-to-programmatically-change-the-active-view.md

latest1.7 KB
Original Source

How to: Programmatically Change the Active View

  • Nov 13, 2018

This example demonstrates how to programmatically change the Scheduler’s view. To do this you should change the value of the SchedulerControl.ActiveViewType property. For instance, changing this property’s value to SchedulerViewType.Week will force the scheduler to use its SchedulerControl.WeekView options.

csharp
using DevExpress.XtraScheduler;
// ...

// Switch the Scheduler to the Day View mode.
schedulerControl1.ActiveViewType = SchedulerViewType.Day;

// Switch the Scheduler to the Work Week View mode.
schedulerControl1.ActiveViewType = SchedulerViewType.WorkWeek;

// Switch the Scheduler to the Week View mode.
schedulerControl1.ActiveViewType = SchedulerViewType.Week;

// Switch the Scheduler to the Month View mode.
schedulerControl1.ActiveViewType = SchedulerViewType.Month;
vb
Imports DevExpress.XtraScheduler
' ...

' Switch the Scheduler to the Day View mode.
SchedulerControl1.ActiveViewType = SchedulerViewType.Day

' Switch the Scheduler to the Work Week View mode.
SchedulerControl1.ActiveViewType = SchedulerViewType.WorkWeek

' Switch the Scheduler to the Week View mode.
SchedulerControl1.ActiveViewType = SchedulerViewType.Week

' Switch the Scheduler to the Month View mode.
SchedulerControl1.ActiveViewType = SchedulerViewType.Month