Loading...

DatePicker

Inherits from Editable Control.


Provides a date picker control which supports selecting a date and optionally a time of day.


Properties:


Value

The selected date of the control. Use this property to bind the selected date of the control to a field in a Model, using the binding syntax.

Example

<DatePicker Name="DatePicker_OrderDate" Value="{Binding Path:Order.OrderDate}" />

Type

Specifies whether the user can select a date or both a date and time of day. Valid values are Date and DateTime. The default value is Date.

Example
This example shows how to enable time of day selection by setting the Type property to "DateTime".

<DatePicker Name="DatePicker_OrderDate" Value="{Binding Path:Order.OrderDate}" Type="DateTime" />

Disabled

Use the Disabled property to disable a control or set it to read-only.
The disabled property support data binding or an explicit value (true, false).

Example

<DatePicker Disabled="{Binding Path:Order.IsShipped}" />

You cannot use both a Binding AND the control APIs at the same time to set the disabled state of a control.
If the Disabled property of a control has a Binding, using the control.Disable() or control.Enable() APIs will not work (binding will win).

Valid values for the Disabled property:

  • True
  • False
  • {Binding}

Hotkey

Specifies the hotkey for the control.

Example

<Input Hotkey="Alt+D"/>

img


Videos