RadDatePicker exposes several client-side events which allow easy and flexible use in a wide range of application scenarios:
- OnDateSelected - fired whenever the selected date of the datepicker is changed.
- OnPopupUpdating - fired only on calendar popup opening prior to
the synchronization of the date in the calendar popup and the DateInput. Cancel this event to override the default DatePicker behavior of synchronizing the date in the DateInput and Calendar controls. This is useful for focusing the Calendar component on a date different from the DateInput one.
The event is obsolete. Please, use OnPopupOpening and OnPopupClosing events instead.
- OnPopupOpening - fired only on calendar popup opening prior to opening the calendar popup and
its synchronizing with the DateInput value. Cancel this event to override the default DatePicker
behavior of synchronizing the date in the DateInput and Calendar controls. This is useful for focusing the Calendar component on a
date different from the DateInput one and/or set some condition for opening the Calendar control.
- OnPopupUpdating - fired only on calendar popup closing prior to
the synchronization of the date in the calendar popup and the DateInput.
This event is useful if you need to set some condition for closing the Calendar control on click of its date cell.
The example demonstrates the following scenario:
Two datepickers representing start / end period are bundled together in the following way: provided that the second datepicker is empty,
on its popup opening the calendar component is focused on the date equal to the sum of the start date (first datepicker) and the duration period.
The calendar popup can not be closed on click of a date less than the selected one in the first datepicker in order to let the user select only
valid period dates.