DatePicker vs. AjaxPanel

2 posts, 0 answers
  1. Jerry
    Jerry avatar
    3 posts
    Member since:
    Feb 2008

    Posted 14 Oct 2010 Link to this post

    Hi!

    I get this error: 'Microsoft JScript runtime error: Invalid set operation on read-only property'.

    When I have this code wrapped in an <telerik:RadAjaxPanel>:
    -----------------------------------------------------------------------------
    <asp:Button ID="TestButton" runat="server" Text="ShowCalendar" OnClick="TestButton_Click" />
    <asp:Panel ID="DatePanel" runat="server" Visible="false">
        <telerik:RadDatePicker ID="DatePicker" runat="server" ShowPopupOnFocus="true" DateInput-ReadOnly="true" />
    </asp:Panel>

    Button Code:
    ----------------
    protected void TestButton_Click(object sender, EventArgs e)
    {
        DatePanel.Visible = true;
    }

    All I'm trying to do is set the panel to visible = true. Doesn't seem to work, I can reproduce this behaviour everytime.

    EDIT:
    If I set the Panels Visible="true" before the page starts I can show and hide the panel as much as I like without any problems. But I want it to be hidden initially.

    EDIT [SOLVED]:
    I solved it by settings the panel style to style="display: none;" And then in code remove the style using DatePanel.Style.Remove("display"); when I want to show the panel, this is only needed once after that I can use visible as I would normally. Strange problem.

    Regards, Jerry
  2. Dimo
    Admin
    Dimo avatar
    8471 posts

    Posted 14 Oct 2010 Link to this post

    Hi Jerry,

    I can't seem to reproduce the described problem on the test page below, but I am glad that you have found a resolution.

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <script runat="server">
     
        protected void TestButton_Click(object sender, EventArgs e)
        {
            DatePanel.Visible = true;
        }
         
    </script>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     
    <head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadControls</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
     
    <asp:Button ID="TestButton" runat="server" Text="ShowCalendar" OnClick="TestButton_Click" />
    <asp:Panel ID="DatePanel" runat="server" Visible="false">
        <telerik:RadDatePicker ID="DatePicker" runat="server" ShowPopupOnFocus="true" DateInput-ReadOnly="true" />
    </asp:Panel>
     
    </telerik:RadAjaxPanel>
     
    </form>
    </body>
    </html>


    All the best,
    Dimo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top