Having many date pickers on a page might render too much HTML and impact performance. RadDatePicker instances can share a RadCalendar control and use it to pick dates.
There are two ways to configure the calendar control:
- by setting its ID to the RadDatePicker.SharedCalendarID property. That can be done in the VS.NET designer.
- by passing a reference of the control to the RadDatePicker.SharedCalendar property. Available to the code-behind logic only.
This example page has four date pickers. The "static" ones have their SharedCalendarID property pointing at the "sharedCalendar" RadCalendar instance. The "dynamic" pickers are configured in the code-behind. The Page_Load event handler creates a new RadCalendar control and sets a reference to it to the pickers' SharedCalendar properties.