System.Web.UI.WebControls.GridView.RowCancelingEdit Event

Occurs when the Cancel button of a row in edit mode is clicked, but before the row exits edit mode.

Syntax

public event GridViewCancelEditEventHandler RowCancelingEdit

Remarks

The GridView.RowCancelingEdit event is raised when the Cancel button of a row in edit mode is clicked, but before the row exits edit mode. This enables you to provide an event-handling method that performs a custom routine, such as stopping the cancel operation if it would put the row in an undesired state, whenever this event occurs.

A System.Web.UI.WebControls.GridViewCancelEditEventArgs object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the cancel operation should be stopped. To stop the cancel operation, set the System.ComponentModel.CancelEventArgs.Cancel property of the System.Web.UI.WebControls.GridViewCancelEditEventArgs object to true.

For more information about handling events, see Consuming Events.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0