How to use AjaxUpdatedControl in RadGrid inside Asp:Repeater?

2 posts, 0 answers
  1. Paulo
    Paulo avatar
    1 posts
    Member since:
    Jul 2015

    Posted 24 Jul 2015 Link to this post

    I dont know how to get the ID if the RadGrid is dynamically 

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePartialRendering="true"
        LoadScriptsBeforeUI="false" EnableCdn="true"   ScriptMode="Release">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadInputManager1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
      <asp:Repeater ID="rp1" runat="server" OnItemDataBound="rp1_ItemDataBound">
                                    <ItemTemplate>
                                        <div class="panel panel-default">
                                            <div class="panel-heading" role="tab" id="headingOne">
                                                <h4 class="panel-title">
                                                    <a role="button" data-toggle="collapse" href='#collapse<%# index %>' aria-expanded="false" aria-controls="collapseOne"><%# Eval("nome") %>
                                                    </a>
                                                </h4>
                                            </div>
                                            <div id='collapse<%# index %>' class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                                                <div class="panel-body">
                                                    <asp:UpdatePanel runat="server" ID="up1">
     
                                                        <ContentTemplate>
                                                            <%--                              <%-- Inicio do Telerik --%>
                                                            <telerik:RadFormDecorator runat="server" DecorationZoneID="demo" EnableRoundedCorners="false" DecoratedControls="All" />
                                                            <div id="demo" class="demo-container no-bg">
                                                                <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Metro"
                                                                    AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
                                                                    AllowAutomaticDeletes="true" AllowSorting="true" OnItemCreated="RadGrid1_ItemCreated"
                                                                    OnItemInserted="RadGrid1_ItemInserted" OnPreRender="RadGrid1_PreRender" OnInsertCommand="RadGrid1_InsertCommand"
                                                                    OnUpdateCommand="RadGrid1_UpdateCommand" OnEditCommand="RadGrid1_EditCommand">
                                                                    <PagerStyle Mode="NextPrevAndNumeric" />
                                                                    <MasterTableView AutoGenerateColumns="False" NoDetailRecordsText="Não há eventos a serem exibidos" NoMasterRecordsText="Não há eventos"
                                                                        DataKeyNames="id" CommandItemDisplay="Bottom">
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn DataField="nomeEspaco" Visible="false" ReadOnly="true"></telerik:GridBoundColumn>
     
                                                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateText="Salvar Alterações" EditText="Alterar" UniqueName="EditCommandColumn">
                                                                            </telerik:GridEditCommandColumn>
     
                                                                            <telerik:GridButtonColumn Text="Deletar" CommandName="Delete" ConfirmText="Você tem certeza que deseja deletar esse registro? não será possível desfazer essa ação" ButtonType="ImageButton" />
                                                                            <telerik:GridBoundColumn DataField="id" HeaderText="ID" ReadOnly="true" SortExpression="id"
                                                                                UniqueName="id" Visible="false" MaxLength="5">
                                                                            </telerik:GridBoundColumn>
     
                                                                            <telerik:GridDropDownColumn DataSourceID="ods2"
                                                                                DataField="periodo" ListTextField="nome" ListValueField="valor" HeaderText="Período" UniqueName="periodo">
                                                                            </telerik:GridDropDownColumn>
     
                                                                            <telerik:GridBoundColumn DataField="nomeCliente" ReadOnly="true" HeaderText="Nome do cliente" SortExpression="ContactTitle"
                                                                                UniqueName="ContactTitle">
                                                                            </telerik:GridBoundColumn>
     
                                                                            <telerik:GridBoundColumn DataField="email" ReadOnly="true" HeaderText="E-mail" SortExpression="CompanyName"
                                                                                UniqueName="CompanyName">
                                                                            </telerik:GridBoundColumn>
     
                                                                            <telerik:GridBoundColumn DataField="telefone" ReadOnly="true" HeaderText="Telefone" SortExpression="Phone"
                                                                                UniqueName="Phone">
                                                                            </telerik:GridBoundColumn>
     
                                                                            <telerik:GridDropDownColumn DataField="formato" DataSourceID="ods5" HeaderText="Formato" SortExpression="formato"
                                                                                ListTextField="nome" ListValueField="valor"
                                                                                UniqueName="formato">
                                                                            </telerik:GridDropDownColumn>
     
                                                                            <telerik:GridDropDownColumn DataField="nomeStatus" DataSourceID="ods3" HeaderText="Status" SortExpression="status"
                                                                                ListTextField="nome" ListValueField="valor"
                                                                                UniqueName="status">
                                                                            </telerik:GridDropDownColumn>
     
                                                                            <telerik:GridDropDownColumn DataField="tipoEvento" DataSourceID="ods4" HeaderText="Tipo de Evento" SortExpression="tipoEvento"
                                                                                ListTextField="nome" ListValueField="valor"
                                                                                UniqueName="tipoEvento">
                                                                            </telerik:GridDropDownColumn>
                                                                        </Columns>
                                                                        <EditFormSettings>
                                                                            <EditColumn CancelText="Cancelar" UpdateText="Salvar Alterações" ButtonType="ImageButton" />
                                                                        </EditFormSettings>
                                                                        <CommandItemSettings AddNewRecordText="Adicionar novo evento" />
                                                                    </MasterTableView>
                                                                </telerik:RadGrid>
                                                                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
                                                        </ContentTemplate>
                                                    </asp:UpdatePanel>
                                                </div>
                                                <%-- Fim do Telerik --%>
                     
                                            </div>
                                        </div>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Jul 2015 Link to this post

    Hello,

    Please try to wrap the Repeater into single asp Panel and add this Panel into the RadAjaxManager settings to update itself. Also set ClientIDMode="AutoID" for your Repeater. The Manager can only handler AutoID, because it uses the server side ClientID property of the control, to Ajaxify it later client side.

    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top