RadCalendar for ASP.NET AJAX

RadControls for ASP.NET AJAX

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

Note

The OnInit event is supported by: RadCalendar.

One parameter is passed to the event handler:

  • sender is the calendar control.

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

CopyASPX
<script type="text/javascript">
       function InitializeCalendar(sender) {
           var todaysDate = new Date();
           var todayTriplet = [todaysDate.getFullYear(), todaysDate.getMonth() + 1, todaysDate.getDate()];
           sender.selectDate(todayTriplet, true);
       }
</script>
<telerik:RadCalendar ID="RadCalendar1" runat="server" >
    <ClientEvents OnInit="InitializeCalendar" />
</telerik:RadCalendar>

See Also

Other Resources