Understanding the EditCommand, UpdateCommand, and CancelCommand Event Handlers

The DataGrid's editing interface contains three buttons, the Edit, Update, and Cancel buttons. Whenever one of these buttons is clicked, the ASP.NET Web page is posted back, and the appropriate DataGrid event is fired. If the Edit button is clicked, the DataGrid's EditCommand event fires; if the Update button is clicked, the DataGrid's UpdateCommand fires; and if the Cancel button is clicked, the DataGrid's CancelCommand is fired.

Recall that the Edit button is displayed for each row and that when it is clicked, the row becomes editable. This editable row then has the Update and Cancel buttons displayed. Then, if the Update button is clicked, the database needs to ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.