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

    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"
                <telerik:AjaxSetting AjaxControlID="btnAddItem"
                         <telerik:AjaxUpdatedControl ControlID="tvProjectSummary" LoadingPanelID="RadAjaxLoadingPanel1"
         <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Width="270px" BackgroundPosition="Center" Skin="Outlook" EnableSkinTransparency="true"
          <telerik:RadTreeView ID="tvProjectSummary" runat="server" AllowNodeEditing="true" EnableDragAndDrop="true" Skin="Metro"  OnClientNodeDropping ="SaveCtrlState" OnNodeDrop="HandleDrop">
                   <telerik:RadTreeNode Value="Root" ImageUrl="Images/subfolder_button.png"
                                AllowEdit="true" Text="NEW PROJECT" Font-Bold="true" Selected="true">
             <asp:Repeater ID="rptItems" runat="server" OnItemCommand="rptItems_ItemCommand">
                     <ul class="options_items">
                             <asp:Label ID="lblItems" runat="server" Text="<%# Container.DataItem %>"></asp:Label>
                             <asp:LinkButton ID="btnAddItem" runat="server" CommandName="AddItem" >Add+</asp:LinkButton>
  2. Pavlina
    Pavlina avatar
    6070 posts

    Posted 24 May 2013 Link to this post


    Please check this example to see how you can achieve your goal:

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

    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. DevCraft R3 2016 release webinar banner
  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