calender clientside DayRender Event not working

3 posts, 0 answers
  1. Ruchi
    Ruchi avatar
    54 posts
    Member since:
    Apr 2012

    Posted 09 Mar 2015 Link to this post

    Hello Team,

    I am using radCalender in my application. I want to highlight some special days with some counts inside it.

    ClientSide dayrender event is not firing. Can anyone help me out?

    Please find code below:
    <telerik:RadCalendar ID="RadCalendar2" runat="server" TitleFormat="MMMM yyyy" AutoPostBack="false">
                            <ClientEvents OnDayRender="OnDayRender"></ClientEvents>
    function  OnDayRender(sender, args) {

    I want to achive functionality provided here(Client-Side) :

    Thanks and Regards,
    Ruchi Patel

  2. Ruchi
    Ruchi avatar
    54 posts
    Member since:
    Apr 2012

    Posted 11 Mar 2015 Link to this post

    Hello Team,

    Solution : Day Render  will not fire client-side will the calendar is navigated to a view different that the current one.

    I need one more help for calender itself, Please find code below:

    <telerik:RadCalendar ID="Cal1" PresentationType="Preview" runat="server" DayNameFormat="Short" ShowRowHeaders="false" ShowOtherMonthsDays="false" Skin="Special" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" EnableMonthYearFastNavigation="false">
            <telerik:DayTemplate ID="RedTemplate" runat="server">
                    <div class="rcTemplate rcRed" id="radTemplateDiv" runat="server" style="background-color: #ffffff; font-weight: normal;">
                        _date<br />
                        <p style="text-align: center; font-weight: bold; font-size: 16px;">_noCount</p>
        <ClientEvents OnInit="initializeCal" OnDayRender="RenderADay" OnLoad="moveToDecember" />

    <telerik:RadCodeBlock ID="rcCal" runat="server">
    <script type="text/javascript">
            var jsonResultData = "";
     var senderForOnLoad = '';
            function moveToDecember(sender) {
                var todaysDate = new Date();
                if (todaysDate.getMonth() != 11)
                    var triplet = [todaysDate.getFullYear() - 1, 12, 25];
                    var triplet = [todaysDate.getFullYear(), 12, 25];
                senderForOnLoad = sender;
                $.get('/api/CalenderWidget?WidMapID=' + 11, function (jsonResult) {
                    for (var i = 0; i < jsonResult.length; i++) {
                       // Here i need to redesign template by replacing "_date" , "_noCount" and "Color" with the result comes in jsonResult.

    Please find comments, I need special days with colors and count comes from Database in jsonResult.

    Let me know if anyone can help.

    Thanks and Regards,
    Ruchi Patel
  3. Pavlina
    Pavlina avatar
    6165 posts

    Posted 12 Mar 2015 Link to this post


    Initially RadCalendar is rendered on the server and that is why OnDayRender client-side event is not raised. Another possible solution is to register your script using server-side DayRender event. Here is an example:
    protected  void Cal1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
           ScriptManager.RegisterStartupScript(Page, Page.GetType(), e.Day.Date.ToString(), "alert('RenderADay');", true);


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top