New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
SelectionChanged
The ASP NET AJAX Calendar control provides the SelectionChanged server event, which is raised when the AutoPostBack property is set to true, and the user changes the current selection by selecting or unselecting a date in the calendar.
The SelectionChanged event handler receives two arguments:
-
The RadCalendar control whose selection was just changed. This argument is of type object, but can be cast to the RadCalendar type.
-
A SelectedDatesEventArgs object. This object has a SelectedDates property which is a collection that lists all the dates in the current selection.
Use the SelectionChanged event handler to respond to changes in the calendar's selection:
C#
protected void RadCalendar1_SelectionChanged(object sender, SelectedDatesEventArgs e)
{
Label1.Text = "Selected dates are:<br />";
for (int i = 0; i < e.SelectedDates.Count; i++)
{
Label1.Text += (e.SelectedDates[i]).Date.ToString() + ",<br />";
}
}