RadAjaxManager Error on RadGrid Updating

2 posts, 0 answers
  1. Jorge
    Jorge avatar
    7 posts
    Member since:
    Jan 2012

    Posted 26 Jan 2012 Link to this post

    Hello,

    I am trying to get async refresh (on button click) for an radgrid, but im getting the following error: 

    "Microsoft JScript runtime error: Sys.InvalidOperationException: No se pudo encontrar UpdatePanel con el id. 'ctl00_ContentPlaceHolder1_ctl00_ContentPlaceHolder1_RadGrid0Panel'. Si se está actualizando dinámicamente, debe estar dentro de otro UpdatePanel."

    The RagGrid ID is "RadGrid0".

    The page i'm using is based on a MaterPage, so my aspx code looks like this:

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
         
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <ajaxsettings>
                <telerik:AjaxSetting AjaxControlID="btnBuscar">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid0" />                   
                     </UpdatedControls>
                </telerik:AjaxSetting>
            </ajaxsettings>
        </telerik:RadAjaxManager>
        <!-- content start -->
        <table>
            <tr>           
                <td>
                    <asp:Button ID="btnBuscar" runat="server" Text="Buscar" OnClick="btnBuscar_Click"
                        ValidationGroup="buscar" />
                </td>
            </tr>
        </table>
             
        <table runat="server" id="PrincipalContainer" visible="False">
            <tr>
                <td valign="top">               
                    <telerik:RadGrid ID="RadGrid0" runat="server" AllowFilteringByColumn="false" GridLines="None"
                        AllowPaging="false" AllowSorting="true" BorderStyle="None" ShowHeader="True"
                        AutoGenerateColumns="False" onitemdatabound="RadGrid0_ItemDataBound">
                        <mastertableview>
                        <Columns>
                            <telerik:GridTemplateColumn runat="server" UniqueName="column1" HeaderText="Cedula">
                                <ItemTemplate>
                                    <asp:Label ID="lblCedula" runat="server" Text='<%# Eval("UserId")%> '></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn runat="server" UniqueName="column2" HeaderText="Nombre">
                                <ItemTemplate>
                                    <asp:Label ID="lblNombre" runat="server" Text='<%# Eval("UserName")%> '></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn runat="server" UniqueName="column3" HeaderText="Bloque">
                                <ItemTemplate>
                                    <telerik:RadComboBox ID="cbBloque" Runat="server" OnSelectedIndexChanged="cbBloque_SelectedIndexChanged" AutoPostBack="True">
                                    </telerik:RadComboBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn runat="server" UniqueName="column4" HeaderText="Habitacion">
                                <ItemTemplate>
                                    <telerik:RadComboBox ID="cbHabitacion" Runat="server" Width="30">
                                    </telerik:RadComboBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn runat="server" UniqueName="column5" HeaderText="">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnAsignarHabitacion" runat="server" OnClick="btnAsignarHabitacion_Click">Asignar</asp:LinkButton>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </mastertableview>
                    </telerik:RadGrid>
    </td>
    </tr>
    </table>
    </asp:Content>

    Thanks :)
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 27 Jan 2012 Link to this post

    Hello,

    please try with below code snippet.

    Remove visible property and use Display attraibute for table.
    <table runat="server" id="PrincipalContainer"  style="display:none;"></table>
    PrincipalContainer.Style.Add("display", ""); // to show

    Note : if you still have issue then please provide your button's click event code.
     



    Thanks,
    Jayesh Goyani
Back to Top