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

DateNavigator Class

A date navigator control.

Namespace: DevExpress.Xpf.Editors.DateNavigator

Assembly: DevExpress.Xpf.Core.v21.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public class DateNavigator :
    Control,
    IDateNavigatorContentContainer,
    IServiceProvider,
    ILogicalOwner,
    IInputElement,
    IDateEditCalendarBase

The following members return DateNavigator objects:

Remarks

DateNavigator

Create a DateNavigator Control

Drag the DevExpress DateNavigator control from the Visual Studio Toolbox onto the form. As a result, the MainWindow.xaml file should appear as follows:

<Window ... 
  xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
  <dxe:DateNavigator HighlightHolidays="False" IsMultiSelect="False" 
                     FirstDayOfWeek="Sunday" CalendarView="Year" /> 
</Window>

Date Types

The DateNavigator control contains the following date types:

Type Property Description
Disabled Date DisabledDates Gets or sets a collection of dates that users cannot select.
Focused Date FocusedDate Gets or sets the date in a calendar that has focus.
Holiday Holidays Gets or sets a collection of custom holidays.
Selected Date SelectedDates Gets or sets a collection of dates that are selected within the DateNavigator control.
Special Date SpecialDates Gets or sets a collection of special dates.
Workday Workdays Gets or sets a collection of workdays in a week.

Tip

To specify a cell’s appearance for each state, use the Appearance property.

Appearance

The DateNavigator control contains the following appearance properties:

Property Description
CalendarView Specifies the calendar calendar display mode.
SelectionView Specifies the calendar view in which a user can select a value.
IsMultiSelect Allows users to select multiple dates.
MinValue Specifies the minimum value that a user can select.
MaxValue Specifies the maximum value that a user can select.
Appearance Specifies a cell’s appearance.
FirstDayOfWeek Specifies the first day of a week.
ShowTodayButton Hides the Today button.
HighlightHolidays Specifies whether the DateNavigator highlights holidays.
HighlightSpecialDates Specifies whether the DateNavigator highlights special dates.

You can use the RefreshCellAppearances() method to raise the RequestCellAppearance event for each cell and clear the cached appearance values.

Scroll To Date

To display a specific date in the current DateNavigator view, use the ScrollToDate(DateTime) method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DateNavigator class.

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