System.Web.UI.WebControls Namespace GridView Class
.NET Framework version 2.0
Occurs when an Update command button within a GridView control is clicked, but before the update operation.
[ VB ]
Public Event RowUpdating As GridViewUpdateEventHandler
[ C# ]
public event GridViewUpdateEventHandler RowUpdating;
[ C++ ]
public: __event GridViewUpdateEventHandler* RowUpdating;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The RowUpdating event is raised whenever an Update button associated with an item in the GridView control is clicked, but before the GridView control updates the record.
This allows you to provide an event-handling method that performs a custom routine, such as checking the values of a record before updating it in the data source, whenever this event occurs.
Information related to the RowUpdating event is passed via a GridViewUpdateEventArgs object to the method assigned to handle the event. The following GridViewUpdateEventArgs properties provide information specific to this event.
Property |
Description |
Cancel |
Gets or sets a value indicating whether the event should be canceled ( inherited from CancelEventArgs ) |
Keys |
Gets a dictionary that contains the key field name/value pairs for the record to update. |
NewValues |
Gets a dictionary that contains the new field name/value pairs for the record to update. |
OldValues |
Gets a dictionary that contains the original non-key field name/value pairs for the record to update. |
RowIndex |
Gets the index of the row being updated. |
GridView Members Allowing Users to Edit Rows in a GridView Control