This is a migrated thread and some comments may be shown as answers.

How to use AjaxUpdatedControl in RadGrid inside Asp:Repeater?

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 24 Jul 2015, 03:01 PM
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>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 29 Jul 2015, 11:52 AM
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
Tags
Grid
Asked by
Paulo
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or