The GridView control raises the RowUpdated event when an Update button in the control is clicked, but after the GridView control updates the record. (An Update button is a button control whose CommandName property is set to "Update".) You can perform a custom routine whenever this event occurs, such as checking the results of an update operation.

A GridViewUpdatedEventArgs object is passed to the event handler, which enables you to determine the number of records that were affected and any exceptions that might have occurred. To determine the number of records that were affected by the update operation, use the AffectedRows property. To determine whether any exceptions occurred, use the Exception property. You can also indicate whether the exception was handled in the event handler by setting the ExceptionHandled property.

To access the key field values for the updated record, use the Keys property. You can access the original non-key field values by using the OldValues property. You can access the updated non-key field values by using the NewValues properties.

By default, the GridView control returns to read-only mode after an update operation. When you handle an exception that occurred during the update operation, you can keep the GridView control in edit mode by setting the KeepInEditMode property to true.