New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnCalendarViewChanging
The OnCalendarViewChanging client-side event handler of the ASP NET AJAX Calendar is called when the calendar navigates to a new view, before the viewable area rendered by the calendar is changed.
The event handler receives two arguments:
-
the RadCalendar object that fired the event.
-
an event arguments object that exposes the following methods:OnCalendarViewChanging event arguments object
Name | Return Type | Arguments | Description |
---|---|---|---|
get_step() | int | Returns the number of views by which the calendar is about to change. | |
set_cancel(value) | bool | Lets you prevent the view from changing. |
This event can be used to pre-process some conditions or visual styles and content before the final rendering of the calendar. The following example uses the OnCalendarViewChanging event to prevent the view from changing unless a date in the current month is selected:
ASPNET
<telerik:RadCalendar RenderMode="Lightweight" ID="RadCalendar1" runat="server" ShowOtherMonthsDays="False" >
<ClientEvents OnCalendarViewChanging="checkSelections" />
</telerik:RadCalendar>