The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientScheduler.GetAppointmentById(id) Method

Client-side function that returns an appointment with the specified ID.


GetAppointmentById(id: string): ASPxClientAppointment


Name Type Description
id string

An appointment's identifier.


Type Description

An ASPxClientAppointment object, representing an appointment on the client.


This method obtains a client appointment by its id.

To get client appointment property values (including custom field values) handle the ASPxScheduler.InitClientAppointment event or use the ASPxClientScheduler.RefreshClientAppointmentProperties method.

The following example illustrates how to handle the ASPxClientScheduler.AppointmentsSelectionChanged client-side event and check if the selected appointment is in the past. To deselect these appointment(s), use the GetAppointmentById method and show a message for an end-user.

function SchedulerSelection(s, e) {
    var date =;
    var ids = e.appointmentIds;
    for (var i = 0; i < ids.length; i++) {
        var appointment = s.GetAppointmentById(ids[i]);
        if (appointment.GetEnd() - date < 0) {                    
            alert("Appointment cannot be selected");


In this example, the ASPxClientScheduler.AppointmentResizing event is handled to disable resizing appointments with the "Completed" status. The ASPxScheduler.InitClientAppointment event is used to pass custom field values (that store additional information about appointments) to the client appointments.

protected void ASPxScheduler1_InitClientAppointment(object sender, InitClientAppointmentEventArgs args) {
    args.Properties.Add("cpCompleted", args.Appointment.CustomFields["LessonCompleted"]);
    args.Properties.Add("cpCustomRecurringFlag", args.Appointment.CustomFields["CustomRecurringFlag"]);
    args.Properties.Add("cpCustomRecurringID", args.Appointment.CustomFields["CustomRecurringID"]);
See Also