Version

RenderDay Property (CalendarClientEvents)

Gets sets name of javascript function which is called when a day in month is rendered.
Syntax
'Declaration
 
Public Property RenderDay As String
public string RenderDay {get; set;}
Remarks

Rendering can be modified using properties of eventArgs. Default rendering can be canceled and application can implement custom rendering.

Example
WebMonthCalendar1.ClientEvents.RenderDay = "WebMonthCalendar1_RenderDay"
WebMonthCalendar1.ClientEvents.RenderDay = "WebMonthCalendar1_RenderDay";
// The client event 'RenderDay' takes two parameters sender and e
        // sender  is the object which is raising the event
        // e is the CalendarRenderDayEventArgs

        function WebMonthCalendar1_RenderDay(sender, e) {

            //Gets the day object 
            var day = e.get_day();
            //Gets value of the index within the grid of the calendar
            var index = day.get_index();
            //---------------------
            // customize style.color of TD element
            var color = '';
            if (index < 7 || index == 42)
                color = '#d00000';
            else if (index < 14 || index == 43)
                color = '#d0d000';
            else if (index < 21 || index == 44)
                color = '#00d000';
            else if (index < 28 || index == 45)
                color = '#00c0c0';
            else if (index < 35 || index == 46)
                color = '#d000d0';
            else if (index < 42 || index == 47)
                color = '#0000c0';
            //---------------
            // This will permanently affect all days in calendar and override all possible css classes
            day.get_element().style.color = color;
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also