New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadScheduler Object

The RadScheduler client-side object represents a single instance of RadScheduler.

The tables below lists the most important, public properties and methods of the RadScheduler client-side object.

Properties

 

NameParametersReturn TypeDescription
get_activeModel()NoneTelerik.Web.UI.ISchedulerModelGets the model that represents the current view.
get_allowDelete()NoneBooleanGets a value indicating whether appointments can be deleted.
set_allowDelete()BooleanNoneSets a value indicating whether appointments can be deleted.
get_allowEdit()NoneBooleanGets a value indicating whether appointments can be edited.
set_allowEdit()BooleanNoneSets a value indicating whether appointments can be edited.
get_allowInsert()NoneBooleanGets a value indicating whether appointments can be inserted.
set_allowInsert()BooleanNoneSets a value indicating whether appointments can be inserted.
get_appointments()NoneTelerik.Web.UI.SchedulerAppointmentCollectionGets a collection of all loaded appointments.
get_attributes()NoneTelerik.Web.UI.SchedulerAttributeCollectionGets a collection of all attributes defined.
get_currentAppointment()NoneTelerik.Web.UI.SchedulerAppointmentGets the currently edited appointment.
get_displayDeleteConfirmation()NoneBooleanGets a value indicating whether a confirmation dialog is displayed before deleting appointments.
set_displayDeleteConfirmation()BooleanNoneSets a value indicating whether a confirmation dialog is displayed before deleting appointments.
get_displayRecurrenceActionDialogOnMove()NoneBooleanGets a value indicating whether a confirmation dialog is displayed before moving recurrent appointments.
set_displayRecurrenceActionDialogOnMove()BooleanNoneSets a value indicating whether a confirmation dialog is displayed before moving recurrent appointments.
get_firstDayStart()NoneDateGets the start date of the current view. In Day View, this is the currently selected day.
get_minutesPerRow()NoneNumberGets the number of minutes a single row represents. Only applicable in Day and Week View.
get_readOnly()NoneBooleanGets a value indicating whether appointments can be modified.
set_readOnly()BooleanNoneSets a value indicating whether appointments can be modified.
get_resources()NoneTelerik.Web.UI.SchedulerResourceCollectionGets all resources of all resource types defined for RadScheduler.
get_resourceTypes()NoneTelerik.Web.UI.ResourceTypeCollectionGets all resource types defined for RadScheduler. See Example 1.
get_groupBy()NoneStringGets all the resources upon which a group by is made. When grouping by date and resources, the returned String is in the following format "Date,[ResourceName_1]". See Example 2.
get_selectedDate()NoneDateGets the currently selected date.
set_selectedDate()DateNoneSets the currently selected date. This property is valid only when RadScheduler is bound to Web Service. See Example 3.
get_selectedView()NoneTelerik.Web.UI.SchedulerViewType EnumGets the type of the currently selected View. SchedulerViewType: { DayView: 0, WeekView: 1, MonthView: 2, ResourceView: 3, TimelineView: 4, MultiDayView: 5, AgendaView: 6, YearView: 7 }. See Example 4.
set_selectedView()SchedulerViewType EnumNoneSets the currently selected view type. This property is valid only when RadScheduler is bound to Web Service. See Example 5.
get_showFullTime()NoneBooleanGets a value indicating whether the Scheduler is displayed in 24-hour View.
set_showFullTime()BooleanNoneSets a value indicating whether the Scheduler is displayed in 24-hour View. This property is valid only when RadScheduler is bound to Web Service.
get_advancedFormSettings()NoneObjectGets the advanced form's settings: enabled, modal, and z-index.
get_appointmentContextMenuIDs()NoneArrayGets the IDs of context menus defined for appointment.
get_appointmentContextMenus()NoneArrayGets the objects of context menus defined for appointment.
get_timeSlotContextMenuIDs()NoneArrayGets the IDs of context menus defined for TimeSlot.
get_timeSlotContextMenus()NoneArrayGets the objects of context menus defined for TimeSlot.
get_appointmentStyleMode()NoneTelerik.Web.UI.AppointmentStyleMode EnumGets the AppointmentStyleMode of RadScheduler. AppointmentStyleMode: { Auto: 0, Simple: 1, Default: 2 }
scheduler.set_appointmentStyleMode()AppointmentStyleModeNoneSets un AppointmentStyleMode of RadScheduler.
get_clientState()NoneStringGets the client state of RadScheduler.
get_clientStateFieldID()NoneStringGets the ID of the field containing the client state of RadScheduler.
get_contentElement()NoneObjectGets the DOM element of the content area of RadScheduler.
get_customAttributeNames()NoneArrayGets the names of custom attributes defined for RadScheduelr, if any.
get_dayViewSettings()NoneObjectGets an object contining the day-start time and day-end time.
get_element()NoneObjectGets the DOM element of RadScheduler.
get_firstDayOfWeek()NoneTelerik.Web.UI.DayOfWeek EnumGets first day of week defined for RadScheduler. DayOfWeek: { Sunday: 0, Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6 }
get_height()NoneStringGets the height of RadScheduler.
get_hoursPanelTimeFormat()NoneStringGets the time format of the hours panel.
get_id()NoneStringGets the id set for RadScheduler.
get_lastDayOfWeek()NoneTelerik.Web.UI.DayOfWeek EnumGets last day of week defined for RadScheduler. DayOfWeek: { Sunday: 0, Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6 }
get_localization()NoneObjectGets an object containing all localization rules defined for RadScheduler.
get_monthViewSettings()NoneArrayGets an object containing MonthView settings, if defined.
scheduler.get_multiDayViewSettings()NoneObjectGets an object containing day start-time and day-end time.
get_timelineViewSettings()NoneArrayGets an object containing TimelineView settings, if defined.
get_numberOfHoveredRows()NoneNumberGets the number of hovered rows.
set_numberOfHoveredRows()NumberNoneSets the number of hovered rows.
get_rowHeight()NoneStringGets the height of rows.
get_scrollTop()NoneNumberGets the vertical scroll position of the content area of RadScheduler.
get_shouldPostbackOnAppointmentContextMenuItemClick()NoneBooleanReturns true if RadScheduler post-backs on AppointmentContextMenu item click, false otherwise.
set_shouldPostbackOnAppointmentContextMenuItemClick()BooleanNoneSets a boolean whether a postback should occur when an item from the Appointment context menu is clicked.
get_shouldPostbackOnTimeSlotContextMenuItemClick()NoneBooleanReturns true if RadScheduler postbacks on TimeSlotContextMenu item click, false otherwise.
set_shouldPostbackOnTimeSlotContextMenuItemClick()BooleanNoneSets a boolean whether a postback should occur when an item from the TimeSlot context menu is clicked.
get_shouldUseClientInlineInsertForm()NoneBooleanReturns true if the inline form is opened when inserting an appointment, false otherwise.
set_shouldUseClientInlineInsertForm()BooleanNoneSets a boolean whether a client inline form should be displayed on appointment insert.
get_shouldUseClientInlineEditForm()NoneBooleanReturns true if the inline form is opened when editing an appointment, false otherwise.
set_shouldUseClientInlineEditForm()BooleanNoneSets a boolean whether an inline form should be displayed on appointment edit.
get_showAllDayRow()NoneBooleanReturns true if AllDayRow is visible, false otherwise.
get_timeLabelRowSpan()NoneNumberGets the row span of time label. Depends on NumberOfSlos property of RadScheduler in TimelineView.
get_validationGroup()NoneStringGet the validation group defined for RadScheduler.
get_visible()NoneBooleanGets true if RadScheduler is visible, false otherwise.
set_visible()BooleanNoneSets the visibility of RadScheduler.
get_webServiceSettings()NoneTelerik.Web.UI.SchedulerWebServiceSettingsGets an object of web service settings defined for RadScheduler.
get_weekViewSettings()NoneObjectGets an object of settings defined for WeekView.

Methods

 

NameParametersReturn TypeDescription
showInsertFormAt()Telerik.Web.UI.ISchedulerTimeSlotNoneShows the in-line insert form at the clicked TimeSlot, equivalently to the TimeSlot's double-clicking. When showing the form, the corresponding FormCreating, AppointmentCreated and FormCreated server-side events are fired. See Example 6.
insertAppointment()Telerik.Web.UI.SchedulerAppointmentNoneInserts an appointment. See Example 7.
updateAppointment()Telerik.Web.UI.SchedulerAppointment,Boolean (optional)NoneUpdates the specified appointment.The second parameter is optional and if set to true , the method will update all appointments in the recurrence series; otherwise an exception will be created for the updated appointment. See Example 8.
editAppointment()Telerik.Web.UI.SchedulerAppointment,Boolean (optional)NoneOpens the AdvancedEditForm for the specified appointment; Identical to double-clicking an appointment. When opening the form, the corresponding FormCreating and FormCreated server-side events are fired.The second parameter is optional and if set to true , the method will edit all appointments in the recurrence series; otherwise an exception will be created for the edited appointment. See Example 9.
editAppointmentWithConfirmation()Telerik.Web.UI.SchedulerAppointmentNoneOpens the AdvancedEditForm for the specified appointment; Identical to double-clicking an appointment. When opening the form, the corresponding FormCreating and FormCreated server-side events are fired.This method is identical to editAppointment , but the user is presented with a confirmation dialog if the appointment is recurring. See Example 10.
deleteAppointment()Telerik.Web.UI.SchedulerAppointment,Boolean (optional)NoneDeletes the specified appointment.The second parameter - deleteSeries - is optional and if set to true ,the method will delete all appointments in the recurrence series; otherwise only the specified appointment will be deleted. See Example 11.
deleteAppointmentWithConfirmation()Telerik.Web.UI.SchedulerAppointmentNoneDeletes the specified appointment.A confirmation dialog is displayed, before deleting the appointment. See Example 12.
getAppointmentDomElement()DOM ElementDOM ElementGets the container Appointment DomElement (if any) of the specified DomElement.
getAppointmentFromDomElement()DOM ElementTelerik.Web.UI.SchedulerAppointmentGets the appointment object from the specified DOM Element.
add_ [eventName] ()Method NameNoneAdds an event handler. See Example 13.
remove_ [eventName] ()Method NameNoneRemoves an event handler. See Example 14.
rebind()NoneNoneWhen RadScheduler is in Client Side binding mode (Web Services), this method can be used to refresh the control and display the appointments. See Example 15.
get_selectedSlots()NoneArray ofISchedulerTimeSlotobjectsGets the currently selected TimeSlots.
get_durationOfSelectedArea()NoneIntegerGets the duration in Milliseconds, of currently selected TimeSlots.
get_durationBetweenTimeSlots()ISchedulerTimeSlot,ISchedulerTimeSlotIntegerGets the time in Milliseconds, between the two TimeSlots including their own duration.
hideInlineForm()NoneNoneHides the inline form opened when double clicking a TimeSlot for inserting an appointment.
hideAdvancedForm()NoneNoneHides the advanced form of RadScheduler.
moveAppointment()Telerik.Web.UI.SchedulerAppointment,Boolean,Telerik.Web.UI.Scheduler.Views.ISchedulerTimeSlot,ISchedulerTimeSlotNoneMoves an appointment from source to target TimeSlot.
showInlineEditForm()Telerik.Web.UI.SchedulerAppointment,Boolean.NoneShows inline edit form for the appointment specified (first argument). The second argument shows whether the recurrence series should be edited. The inline edit form shows only when EnableAdvancedForm property of RadScheduler is set to false.
showAdvancedEditForm()Telerik.Web.UI.SchedulerAppointment,Boolean.NoneShows advanced edit form for the appointment specified (first argument). The second argument shows whether the recurrence series should be edited. The edit form shows only when EnableAdvancedForm property of RadScheduler is set to true (as it is by default).
showInlineInsertForm()Telerik.Web.UI.Scheduler.Views.ISchedulerTimeSlot,Telerik.Web.UI.Scheduler.Views.ISchedulerTimeSlotNoneOpens an inline insert form at the specified TimeSlots.
showAdvancedInsertForm())DateNoneOpens an adavanced insert form at the specified time.
showInsertFormAt()Telerik.Web.UI.Scheduler.Views.ISchedulerTimeSlot,Telerik.Web.UI.Scheduler.Views.ISchedulerTimeSlotNoneOpens an insert form at the specified TimeSlots.
showAllDayAdvancedInsertForm()DateNoneOpens an advanced insert form with the AllDay CheckBox checked.
showAllDayInlineInsertForm()DateNoneOpens an inline insert form with the AllDay property set to true.

Example 1: Display all resource types.

JavaScript
function clientFormCreated(scheduler, args)
{
	var mode = args.get_mode();
	if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert | |
	mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit)
	{
		//Alerts all resource types on AdvancedInsert/Edit Form created.  
		scheduler.get_resourceTypes().forEach(function (type)
		{
			alert(type.get_name());
		});
	}
} 

Example 2: Get the resources set to the Scheduler's GroupBy property.

JavaScript
	function pageLoad()
	{
		var scheduler = $find('<%=RadScheduler1.ClientID %>');
		var groupedBy = scheduler.get_groupBy();
		if (groupedBy != null)
		{
			alert(groupedBy);
		}
	}
ASP.NET
<telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" 
	GroupBy="Date, User" GroupingDirection="Horizontal">
</telerik:RadScheduler>

Example 3: Set the selected Date.

JavaScript
function pageLoad()
{
	var scheduler = $find('<%=RadScheduler1.ClientID %>');
	// Are we using Web Service data binding?
	if (!scheduler.get_webServiceSettings().get_isEmpty())
	{
		scheduler.set_selectedDate(new Date());
	}
	else
	{
		alert("RadScheduler is not bound to Web Service!");
	}
}

Example 4: Get the type of the currently selected View.

JavaScript
function pageLoad()
{ 
	var scheduler = $find('<%=RadScheduler1.ClientID %>'); 
	if (scheduler.get_selectedView() == Telerik.Web.UI.SchedulerViewType.DayView) 
	{ 
		alert("The selected view is DayView"); 
	} 
}

Example 5: Set the selected view type.

JavaScript
function pageLoad()
{
	var scheduler = $find('<%=RadScheduler1.ClientID %>');
	// Are we using Web Service data binding?
	if (!scheduler.get_webServiceSettings().get_isEmpty())
	{
		var currentView = scheduler.get_selectedView();
		if (currentView != Telerik.Web.UI.SchedulerViewType.TimelineView)
		{
		  alert("The Scheduler's currently selected view will be" + 
				"automatically changed to TimelineView after closing the dialog!");
		  scheduler.set_selectedView(Telerik.Web.UI.SchedulerViewType.TimelineView);
		}
	}
	else
	{
		alert("RadScheduler is not bound to Web Service!");
	}
}

Example 6: Show the in-line insert form at the clicked TimeSlot, equivalently to the TimeSlot's double-clicking.

JavaScript
function onClientTimeSlotClick(sender, eventArgs)
{
	var targetSlot = eventArgs.get_targetSlot();
	sender.showInsertFormAt(targetSlot);
}		

Example 7: Insert an appointment.

JavaScript
function onClientTimeSlotClick(sender, eventArgs)
{
	var newAppointment = new Telerik.Web.UI.SchedulerAppointment();

	var startTime = eventArgs.get_targetSlot().get_startTime();

	var endTime = new Date(startTime);
	endTime.setMinutes(endTime.getMinutes() + 45);

	newAppointment.set_start(startTime);
	newAppointment.set_end(endTime);
	newAppointment.set_subject("Manually Inserted Appointment");

	sender.insertAppointment(newAppointment);
}

Example 8: Update an appointment.

JavaScript
function onClientAppointmentClick(sender, eventArgs)
{
	var appointment = eventArgs.get_appointment();
	var newEnd = new Date(appointment.get_end());
	newEnd.setMinutes(newEnd.getMinutes() + 45);
	appointment.set_end(newEnd);
	sender.updateAppointment(appointment, false);
}

Example 9: Open the AdvancedEditForm for the specified appointment.

JavaScript
function onClientAppointmentClick(sender, eventArgs)
{
	var appointment = eventArgs.get_appointment();
	sender.editAppointment(appointment);
} 

Example 10: Open the AdvancedEditForm with confirmation for the specified appointment.

JavaScript
function onClientAppointmentClick(sender, eventArgs)
{
	var appointment = eventArgs.get_appointment();
	sender.editAppointmentWithConfirmation(appointment);
} 

Example 11: Delete the appointment.

JavaScript
function onClientAppointmentClick(sender, eventArgs)
{
	var appointment = eventArgs.get_appointment();
	sender.deleteAppointment(appointment);
}

Example 12: Delete the appointment and show a confirmation dialog before the delition.

JavaScript
function onClientAppointmentClick(sender, eventArgs)
{
	var appointment = eventArgs.get_appointment();
	sender.deleteAppointmentWithConfirmation(appointment);
}

Example 13: Add an OnClientAppointmentClick handler to the control.

JavaScript
function pageLoad()
{
	var scheduler = $find("<%=RadScheduler1.ClientID %>");
	scheduler.add_appointmentClick(function (sender, args)
	{
		alert("You have clicked the  '"+ 
			args.get_appointment().get_subject() +  "'  appointment" );
	});
}

Example 14: Remove the control's OnClientAppointmentClick handler.

JavaScript
function pageLoad()
{
	var scheduler = $find("<%=RadScheduler1.ClientID %>");
	scheduler.add_appointmentClick(appointmentClick);
}

function appointmentClick(sender, args)
{
	alert("You have clicked the  '" + args.get_appointment().get_subject() + "'  appointment");
	sender.remove_appointmentClick(appointmentClick);
}

Example 15: Refresh the RadScheduler when it is in Client Side binding mode (Web Services).

JavaScript
function OnClientSelectedIndexChanged(sender, args)
{
	teacherID = args.get_item().get_value();
	var scheduler = $find('<%=RadScheduler1.ClientID %>');
	scheduler.rebind();
}

function OnClientAppointmentsPopulating(sender, eventArgs)
{
	eventArgs.get_schedulerInfo().TeacherID = teacherID;
}

A RadComboBox control contains all the resources defined for RadScheduler. On its SelectedIndexChanged, only appointments with the selected resource are displayed inRadScheduler.

See Also

In this article
PropertiesMethodsSee Also
Not finding the help you need?
Contact Support