Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Calendar.DisplayDateEnd Property

Gets or sets the last date in the date range that is available in the calendar.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public Nullable<DateTime> DisplayDateEnd { get; set; }
<Calendar DisplayDateEnd="dateTimeString"/>

XAML Values

dateTimeString

A date that is in one of the formats that are listed in the DateTime XAML Syntax topic.

Property Value

Type: System.Nullable<DateTime>
The last date that is available in the calendar.

You can restrict the range of a Calendar by setting the DisplayDateStart and DisplayDateEnd properties. A user cannot scroll to or select dates outside of this range. If you set the SelectedDate property to a date that is after DisplayDateEnd, DisplayDateEnd is set to the same value as SelectedDate.

The following code sets up a Calendar with a particular range of displayable dates, and sets the currently selected and displayed date.

// Create a Calendar that displays 1/10/2009
// through 4/18/2009.
Calendar basicCalendar = new Calendar();
basicCalendar.DisplayDateStart = new DateTime(2009, 1, 10);
basicCalendar.DisplayDateEnd = new DateTime(2009, 4, 18);
basicCalendar.DisplayDate = new DateTime(2009, 3, 15);
basicCalendar.SelectedDate = new DateTime(2009, 2, 15);

// root is a Panel that is defined elswhere.
root.Children.Add(basicCalendar);
<!-- Create a Calendar that displays 1/10/2009
           through 4/18/2009. -->
<Calendar Margin="20" 
          SelectedDate="2/15/2009"
          DisplayDate="3/15/2009"
          DisplayDateStart="1/10/2009"
          DisplayDateEnd="4/18/2009"/>

.NET Framework

Supported in: 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.