Shared Calender with RadAjaxManager Fails after Postback

2 posts, 1 answers
  1. TheLostLeaf
    TheLostLeaf avatar
    34 posts
    Member since:
    Feb 2007

    Posted 03 Mar 2011 Link to this post


    I've had this problem for a while and have not found a solution. When using a Shared Calender with the RadAjaxManager, the pop-up only works the 1st time. Here is the simplest implementation of the example.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <head runat="server">
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
        <div id="divContent" runat="server">
            <telerik:RadCalendar ID="RadCalendar1" Runat="server"></telerik:RadCalendar>
    using System;
    using System.Drawing;
    using Telerik.Web.UI;
    public partial class Default : System.Web.UI.Page 
        protected void Page_Load(object sender, EventArgs e)
        void LoadDatesShared()
            for (int i = 0; i < 10;i++ )
                RadDatePicker rdp = new RadDatePicker();
                rdp.SharedCalendar = RadCalendar1;
                rdp.AutoPostBack = true;
                rdp.ID = "rdp" + i.ToString();
                rdp.SelectedDateChanged += new Telerik.Web.UI.Calendar.SelectedDateChangedEventHandler(rdp_SelectedDateChanged);
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(rdp, rdp);
        void rdp_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
            ((RadDatePicker)sender).BackColor = Color.LightGreen;

    Thanks !
  2. Answer
    Tsvetina avatar
    2102 posts

    Posted 09 Mar 2011 Link to this post


    When you are using shared calendars with AJAX you need to make sure that each picker updates itself, all other pickers and the shared calendar. In your case only the first condition is fulfilled. This is because the client states of all pickers should be refreshed when they are sharing a calendar in order for them to be able to find the client object of the control.

    Best wishes,
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top