RadListView update command not fired

2 posts, 0 answers
  1. Sambathraj
    Sambathraj avatar
    16 posts
    Member since:
    Jan 2011

    Posted 08 Jan 2014 Link to this post

    hi,

    I have created a UserControl to display the data using RadListView. I am loading this user Control dynamically in a webpage.



    List is displayed properly and all the data is shown correctly. When user clicks on the edit link, it is able to go into edit mode. But when user clicks on the update button, it doesn't fire the Item Command event handler. It just closes the edit view and nothing is saved. When the control is loaded dynamically, should I have to register the event handlers again? In my case the Edit item template is a custom layout and button is inside the layout. Can you help to solve this issue?



    <EditItemTemplate>
               <table cellspacing="0" cellpadding="0" style="width100%" border="0">
                   <tr>
                       <td colspan="2" align="right">
                           <asp:LinkButton ID="UpdatePropertiesButton" runat="server" Text="Update" CommandName="Update" ></asp:LinkButton>
                           &nbsp;&nbsp;&nbsp;<asp:LinkButton ID="BtnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="False"></asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                   </tr>
    </table>
    </EditItemTemplate>
    








  2. Marin
    Admin
    Marin avatar
    1043 posts

    Posted 10 Jan 2014 Link to this post

    Hello,

    The markup for the update button looks properly configured - so it should fire the update command. Another thing that can cause issues might be the way you load the user control on the page. Normally this should be done in the OnInit or OnLoad event so that all event handlers are registered as expected. Also you can check whether any other commands such as delete or edit fire the ItemCommand event of the control or also have the same issue as the update command after postback. 
    Also it might depend how exactly you wire up the event handlers and in which event in code or markup you do this. You can verify that after the listview goes in edit mode the ItemCommand event is still attached as expected.

    Regards,
    Marin
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top