RadCalendar for ASP.NET

Client-Side API Send comments on this topic.
See Also
Telerik RadCalendar Client-Side > Client-Side API

Glossary Item Box

Telerik RadCalendar  exposes several JavaScript structures: functions and events which allow you to control the behavior of the calendar on the client-side.

All the client-side functions that take or return date values use a custom interchange format, for transferring dates. The format (due to javascript as Date object regarding calendars different than Gregorian) is as follows: [2005, 11, 15]. This is a triplet array where the first position is the year, the second is the month and the third is the day.

The selected dates array returned by some functions is an array, where every cell of is a date representation triplet. This representation looks like this, [ [2005, 11, 15], [2005, 11, 16], [2005, 11, 17], [2005, 11, 18], [2005, 11, 19], [2005, 11, 20] ]

 

The  main elements of the RadCalendar Client-Side API are shown below.

 

Element

Description
RadCalendar

The Telerik RadCalendar object in javascript

GetSelectedDates

Returns an array of date triplets, representing the selected dates contained in the calendar

SelectDate(date, navigate)

Takes a triplet representation of a date, and if valid selects it in the calendar. The second input parameter is of boolean type and denotes whether the calendar should change its visual state by navigating visually to the selected date. You have to use the true value as an input, if false is used the date will be selected but the calendar won't change its visual state.

SelectDates(dates, navigate)

Takes an array of triplets representing dates and if valid selects them in the calendar. The second input parameter is Boolean type and denotes whether the calendar should change its visual state by navigating visually to the last date of the array. One must use true value as an input, if false is used the dates will be selected but the calendar won't change its visual state.

UnselectDate(date)

Takes a triplet representation of a date and if valid, deselects it in the calendar.

UnselectDates(dates)

Takes an array of triplets representing dates and if valid, deselects them in the calendar.

NavigateToDate(date) Takes a triplet representation of a date and if valid navigates the calendar view to the supplied date.
This method is a navigation enhancement and does not perform a selection.

GetRangeMinDate()

Returns an array of date triplets, representing the RangeMinDate of the calendar.

SetRangeMinDate(date)

Takes an array of triplets representing the date and if valid set the RangeMinDate to it.

GetRangeMaxDate()

Returns an array of date triplets, representing the RangeMaxDate of the calendar.

SetRangeMaxDate(date)

Takes an array of triplets representing the date and if valid set the RangeMaxDate to it.

CalculateDateFromStep(step)

Returns a triplet representation of a date which is calculated from the current calendar view with some step. For example, if the step is -3, the function returns three months before, if it is 3 - it returns a date, representing three months later.

RangeValidation.IsDateValid(date)

Takes an array of date triplets and return true/false if the date is/is not in the calendar date range, defined by RangeMinDate and RangeMaxDate.



 

See Also