DisplayDate Property

DatePicker.DisplayDate Property


Gets or sets the date to display.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public DateTime DisplayDate { get; set; }

Property Value

Type: System.DateTime

The date to display. The default is DateTime.Today.

Exception Condition

The specified date is not in the range defined by DisplayDateStart. and DisplayDateEnd.

This property affects the Calendar of the DatePicker. For more information, see the Calendar.DisplayDate property.

Identifier field


Metadata properties set to true


This property allows the developer to specify a date to display if SelectedDate is null.

<DatePicker DisplayDate="dateTimeString"/>


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

The following example creates a DatePicker that is initialized with its calendar open and displaying July 7, 2009.

.NET Framework
Available since 4.0
Available since 2.0
Return to top
© 2015 Microsoft