Skip to main content
A newer version of this page is available. .

SchedulerControl.DateNavigatorQueryActiveViewType Event

Enables you to specify the active view type of the Scheduler when the user selects dates in the bound DateNavigator.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v19.2.dll

Declaration

public event DateNavigatorQueryActiveViewTypeHandler DateNavigatorQueryActiveViewType

Event Data

The DateNavigatorQueryActiveViewType event's data class is DateNavigatorQueryActiveViewTypeEventArgs. The following properties provide information specific to this event:

Property Description
NewViewType Gets or sets the type of the view to be used by the scheduler to show its data after the date range selected in the bound DateNavigator has been changed.
OldViewType Gets the type of the view used by the scheduler to show its data before the date range selected in the bound DateNavigator is changed.
SelectedDays Gets the collection of dates selected in the DateNavigator bound to scheduler.

Example

This example uses the SchedulerControl.DateNavigatorQueryActiveViewType event of the SchedulerControl to conditionally switch the Scheduler view. When an entire week is selected in the Date Navigator, the Scheduler switches to the Week View.

using DevExpress.XtraScheduler;
using System.Windows.Forms;
        void schedulerControl1_DateNavigatorQueryActiveViewType(object sender, DateNavigatorQueryActiveViewTypeEventArgs e)
        {
            if ((e.SelectedDays.Count == 7) && (e.SelectedDays.Start.DayOfWeek == schedulerControl1.FirstDayOfWeek))
            {
                e.NewViewType = SchedulerViewType.Week;
            }
        }

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DateNavigatorQueryActiveViewType event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also