windowsforms-devexpress-dot-xtrascheduler-dot-datenavigator-8709a08f.md
Gets or sets a single date selected in the DateNavigator control.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
[DXCategory("Appearance")]
public override DateTime DateTime { get; set; }
<DXCategory("Appearance")>
Public Overrides Property DateTime As Date
| Type | Description |
|---|---|
| DateTime |
A DateTime object that is the selected date.
|
Use the DateTime property to select a single date in the DateNavigator in code.
To prevent end-users from selecting multiple dates in the DateNavigator, set the CalendarControlBase.SelectionMode property to Single.
If multiple dates are selected, the DateTime returns the date on which the mouse had focus most recently. To obtain selected dates, use the CalendarControlBase.SelectedRanges property, CalendarControlBase.SelectionStart and CalendarControlBase.SelectionEnd properties.
To select multiple dates programmatically, use the SchedulerViewBase.SetVisibleIntervals method of the SchedulerControl bound to the DateNavigator control via its DateNavigator.SchedulerControl property.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DateTime property.
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.
winforms-scheduler-country-specific-work-week-holidays/CS/Form1.cs#L30
dateNavigator1.HighlightHolidays = true;
dateNavigator1.DateTime = new DateTime(2015, 02, 26);
winforms-scheduler-country-specific-work-week-holidays/VB/Form1.vb#L29
dateNavigator1.HighlightHolidays = True
dateNavigator1.DateTime = New DateTime(2015, 02, 26)
For day As Integer = 9 To 14 - 1
See Also