Skip to content

Latest commit

 

History

History
69 lines (41 loc) · 3.25 KB

date-items.md

File metadata and controls

69 lines (41 loc) · 3.25 KB
title page_title description slug tags published position
Date Items
Date Items
Check our "Date Items" documentation article for the RadDateTimePicker {{ site.framework_name }} control.
raddatetimepicker-features-date-items
date,items
true
5

Date Items

When you use the RadDateTimePicker control you can customize the date items included in the Calendar view. You can define start and end dates for the entries in the calendar. You do this using the following properties:

  • DisplayDateStart - it is of type DateTime and represents the starting date of the date items in your Calendar.

  • DisplayDateEnd - it is again of type DateTime and represents the ending date of the items in your Calendar.

If you specify these properties you will be able to select a date only in the range of the chosen start and end dates.

Here is an example of setting these properties in XAML:

XAML

{{region xaml-raddatetimepicker-features-date-items_0}} <telerik:RadDateTimePicker DisplayDateStart="1/1/2010" DisplayDateEnd="11/15/2010"/> {{endregion}}

Here is the result:

{{ site.framework_name }} RadDateTimePicker with DisplayDateStart and DisplayDateEnd Limitation

The Next Month button is not active because of the DisplayDateEnd property's value set in the example.

tipYou can further restrict the input by indicating a selectable start and end dates. These dates will allow you to select only within a predefined range, but you would still have the ability to browse within the range of the display start and end dates. [Read more here]({%slug raddatetimepicker-features-selection%})

Using a default display date

You can also set the default date visible when the calendar appears. The property you have to use is called DisplayDate and is of type DateTime.

Notice that the DisplayDate is different from the SelectedDate property. The DisplayDate points out just the default month and year visible when the calendar first pops up, nothing is selected.

For example:

XAML

{{region xaml-raddatetimepicker-features-date-items_1}} <telerik:RadDateTimePicker DisplayDate="4/1/2010"/> {{endregion}}

The result of this example will be that when you click on the RadDateTimePicker's drop-down button for the first time in the calendar you will not see the current month and year but instead the month and year defined in the DisplayDate property.

{{ site.framework_name }} RadDateTimePicker with Custom DisplayDate

tipIf you set the DisplayDate property to a value which is not in the range of the DisplayDateStart and DisplayDateEnd properties you will end up with a parse error exception.

See Also

  • [Overview]({%slug raddatetimepicker-overview%})

  • [Visual Structure]({%slug raddatetimepicke-visual-structure%})

  • [Clock Items]({%slug raddatetimepicker-features-clock-items%})

  • [Selection]({%slug raddatetimepicker-features-selection%})

  • [Formatting]({%slug raddatetimepicker-features-formatting%})

  • [How to set the first day of the week]({%slug raddatetimepicker-how-to-set-first-day-calendar%})