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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.