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

RadListView update command not fired

1 Answer 117 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Sambathraj
Top achievements
Rank 1
Sambathraj asked on 08 Jan 2014, 08:13 AM

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>








1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 10 Jan 2014, 09:59 AM
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.
Tags
ListView
Asked by
Sambathraj
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or