New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

OnInit

The OnInit client-side event handler is called when the calendar is first constructed.

The event handler receives one argument:

  1. the RadCalendar object that fired the event.

The following example uses the OnInit event to initialize the selection to today's date:

<telerik:RadCalendar RenderMode="Lightweight" ID="RadCalendar1" runat="server" >
    <ClientEvents OnInit="initializeCalendar" />
</telerik:RadCalendar>
function initializeCalendar(sender) {
    var todaysDate = new Date();
    var todayTriplet = [todaysDate.getFullYear(), todaysDate.getMonth() + 1, todaysDate.getDate()];

    sender.selectDate(todayTriplet, true);
}

See Also

In this article