RadCalendar for ASP.NET

OnDayRender Send comments on this topic.
Telerik RadCalendar Client-Side > Client-Side Events > OnDayRender

Glossary Item Box

Fired

For every calendar day cell when the calendar is rendered as a result of client-side navigation.

Arguments

calendarInstance - the Telerik RadCalendar instance that raised the event.

args (composite argument)

  • args.Cell - represents the currently processed calendar day cell
  • args.Date - an array triplet [year, month, date] representing the processed date
  • args.RenderDay - a RenderDay object corresponding to the server-side RadCalendarDay (this argument is defined only for calendar days that belong to the current month and are within the (RangeMinDate, RangeMaxDate) interval.

Can be cancelled

No

Example

ASPX/ASCX Copy Code
<script type="text/javascript">
function OnDayRender(calendarInstance, args)
{
    if (args.RenderDay)
    {
        args.Cell.style["backgroundColor"] = "green";
        args.Cell.innerHTML = "test";
    }
    else
    {
        args.Cell.style.backgroundColor = "yellow";
    };
}
</script>

<rad:RadCalendar ID="RadCalendar1" runat="server">
    <ClientEvents OnDayRender="OnDayRender" />
</rad:RadCalendar>
 
Remarks

This event mimics the server-side DayRender event - gives final control over the output of a specific calendar day cell. This event can be used to apply final changes to the output (content and visual styles) just before the content is displayed.