Cannot ajaxify button inside the repeater

3 posts, 0 answers
  1. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 21 May 2013 Link to this post

    Hi,
    I have a repeater control with a button inside.
    On button click, I want to add items to the tree view.
    I am trying to ajaxify the button inside the repeater, but it works only for the first row.
    Button in all other rows does full postback.
    Could you help please.
    Here is my code:
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings
                <telerik:AjaxSetting AjaxControlID="btnAddItem"
                     <UpdatedControls
                         <telerik:AjaxUpdatedControl ControlID="tvProjectSummary" LoadingPanelID="RadAjaxLoadingPanel1"
                         </telerik:AjaxUpdatedControl
                     </UpdatedControls
                 </telerik:AjaxSetting
             </AjaxSettings>
         </telerik:RadAjaxManager>
         <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Width="270px" BackgroundPosition="Center" Skin="Outlook" EnableSkinTransparency="true"
          </telerik:RadAjaxLoadingPanel
      
          <telerik:RadTreeView ID="tvProjectSummary" runat="server" AllowNodeEditing="true" EnableDragAndDrop="true" Skin="Metro"  OnClientNodeDropping ="SaveCtrlState" OnNodeDrop="HandleDrop">
               <Nodes>
                   <telerik:RadTreeNode Value="Root" ImageUrl="Images/subfolder_button.png"
                                AllowEdit="true" Text="NEW PROJECT" Font-Bold="true" Selected="true">
                    </telerik:RadTreeNode>
                </Nodes>
             </telerik:RadTreeView>
               
             <asp:Repeater ID="rptItems" runat="server" OnItemCommand="rptItems_ItemCommand">
                 <ItemTemplate>
                     <ul class="options_items">
                         <li>
                             <asp:Label ID="lblItems" runat="server" Text="<%# Container.DataItem %>"></asp:Label>
                             <asp:LinkButton ID="btnAddItem" runat="server" CommandName="AddItem" >Add+</asp:LinkButton>
                         </li>
                      </ul>
                  </ItemTemplate>
              </asp:Repeater>
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 24 May 2013 Link to this post

    Hello,

    Please check this example to see how you can achieve your goal:
    http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Manager/PartialAjaxification/DefaultCS.aspx

    You can use similar approach with repeater, treeview, etc.

    Regards,
    Pavlina
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 28 May 2013 Link to this post

    It works.
    Thank you!
Back to Top