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

Events Overview

RadScheduler has a number of properties which value is the name of a JavaScript function that executes when specific client-side events occur. These events are listed below:

Web Service binding specific events:

Reminder related events:

To use these events, simply write a JavaScript function that can be called when the event occurs. Then assign the name of the JavaScript function as the value of the the corresponding RadScheduler property.


<script type="text/javascript">   
  function OnClientAppointmentInserting(sender, eventArgs)
  {
     var now = new Date();
     if (eventArgs.get_startTime() < now)
         eventArgs.set_cancel(true);
  }
</script>

    // #region client-side-programming-events_1

function onClickHandler1()
{
    alert("First handler occurs");
}
function onClickHandler2()
{
    alert("Second handler occurs");
}
function pageLoad()
{
     var Scheduler = $find("<%= RadScheduler1.ClientID %>");

     Scheduler.add_timeSlotClick(OnClickHandler1);
     Scheduler.add_timeSlotClick(OnClickHandler2);
}      

You can also assign event handlers in client-side code. When using the client-side API, pass a reference to the event handler rather than its name. One advantage of using the client-side API is that you can attach multiple event handlers to one event using the standard MS AJAX convention:


function onClickHandler1()
{
    alert("First handler occurs");
}
function onClickHandler2()
{
    alert("Second handler occurs");
}
function pageLoad()
{
     var Scheduler = $find("<%= RadScheduler1.ClientID %>");

     Scheduler.add_timeSlotClick(OnClickHandler1);
     Scheduler.add_timeSlotClick(OnClickHandler2);
}      

Another advantage of the client-side API is that you can detach an event handler dynamically:


function removeOnClick2()
{
     var Scheduler = $find("<%= RadScheduler1.ClientID %>");
     Scheduler.remove_timeSlotClick(OnClickHandler2);
}       

Note that on the client-side, the names of events are slightly different than on the server-side. The following table shows the correspondence between client-side and server-side names:

Server-Side Name Client-Side Name Methods to Add and Remove
OnClientAppointmentClick appointmentClick add_appointmentClick, remove_appointmentClick
OnClientAppointmentDoubleClick appointmentDoubleClick add_appointmentDoubleClick, remove_appointmentDoubleClick
OnClientAppointmentDeleteing appointmentDeleting add_appointmentDeleting, remove_appointmentDeleting
OnClientAppointmentEditing appointmentEditing add_appointmentEditing, remove_appointmentEditing
OnClientAppointmentInserting appointmentInserting add_appointmentInserting, remove_appointmentInserting
OnClientAppointmentMoveStart appointmentMoveStart add_appointmentMoveStart, remove_appointmentMoveStart
OnClientAppointmentMoving appointmentMoving add_appointmentMoving, remove_appointmentMoving
OnClientAppointmentMoveEnd appointmentMoveEnd add_appointmentMoveEnd, remove_appointmentMoveEnd
OnClientAppointmentResizeStart appointmentResizeStart add_appointmentResizeStart, remove_appointmentResizeStart
OnClientAppointmentResizing appointmentResizing add_appointmentResizing, remove_appointmentResizing
OnClientAppointmentResizeEnd appointmentResizeEnd add_appointmentResizeEnd, remove_appointmentResizeEnd
OnClientAppointmentContextMenu appointmentContextMenu add_appointmentContextMenu, remove_appointmentContextMenu
OnClientTimeSlotClick timeSlotClick add_timeSlotClick, remove_timeSlotClick
OnClientTimeSlotContextMenu timeSlotContextMenu add_timeSlotContextMenu, remove_timeSlotContextMenu
OnClientRecurrenceActionDialogShowing recurrenceActionDialogShowing add_recurrenceActionDialogShowing, remove_recurrenceActionDialogShowing
OnClientRecurrenceActionDialogClosed recurrenceActionDialogClosed add_recurrenceActionDialogClosed, remove_recurrenceActionDialogClosed
OnClientFormCreated formCreated add_formCreated, remove_formCreated
OnClientAppointmentsPopulating appointmentsPopulating add_appointmentsPopulating, remove_appointmentsPopulating
OnClientAppointmentsPopulated appointmentsPopulated add_appointmentsPopulated, remove_appointmentsPopulated
OnClientAppointmentDataBound appointmentDataBound add_appointmentDataBound, remove_appointmentDataBound
OnClientAppointmentCreated appointmentCreated add_appointmentCreated, remove_appointmentCreated
OnClientResourcesPopulating resourcesPopulating add_resourcesPopulating, remove_resourcesPopulating
OnClientResourcesPopulated resourcesPopulated add_resourcesPopulated, remove_resourcesPopulated
OnClientDataBound dataBound add_dataBound, remove_dataBound
OnClientRequestFailed requestFailed add_requestFailed, remove_requestFailed
OnClientAppointmentWebServiceInserting appointmentWebServiceInserting add_appointmentWebServiceInserting, remove_appointmentWebServiceInserting
OnClientAppointmentWebServiceDeleting appointmentWebServiceDeleting add_appointmentWebServiceDeleting, remove_appointmentWebServiceDeleting
OnClientAppointmentWebServiceUpdating appointmentWebServiceUpdating add_appointmentWebServiceUpdating, remove_appointmentWebServiceUpdating
OnClientRecurrenceExceptionCreating recurrenceExceptionCreating add_recurrenceExceptionCreating, remove_recurrenceExceptionCreating
OnClientRecurrenceExceptionsRemoving recurrenceExceptionsRemoving add_recurrenceExceptionsRemoving, remove_recurrenceExceptionsRemoving

See Also

In this article