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

OnDayRender

The OnDayRender client-side event handler of the ASP NET AJAX Calendar is called for every calendar day cell when the calendar is rendered as a result of client-side navigation. This event mimics the server-side DayRender event, giving final control over the output of a specific calendar day cell. This event can be used to apply changes to the calendar cells when the user navigates that are identical to the server-side event handler applied to the cells in the initial view.

The event handler receives two arguments:

  1. the RadCalendar object that fired the event.

  2. an event arguments object that exposes the following methods:OnDayRender event arguments object

NameReturn TypeArgumentsDescription
get_renderDay()RenderDay client-side objectReturns the client-side RenderDay object that represents the day being rendered. This value is null if the cell represents a valueoutside the range specified by RangeMinDate and RangeMaxDate .
get_date()Array objectReturns the triplet for the date the cell represents.
get_cell()Cell elementReturns object for the cell being rendered.

The following example uses the OnDayRender event to change the text for the non-current month and for dates that fall outside the selectable range. It also changes the background color on weekend days:

ASPNET
<telerik:RadCalendar RenderMode="Lightweight" ID="RadCalendar1" runat="server">
    <ClientEvents OnDayRender="dayRender" />
</telerik:RadCalendar>  			

See Also

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