System.Web.UI.WebControls.GridView.RowDeleting Event

Occurs when a row's Delete button is clicked, but before the System.Web.UI.WebControls.GridView control deletes the row.

Syntax

public event GridViewDeleteEventHandler RowDeleting

Remarks

The GridView.RowDeleting event is raised when a row's Delete button is clicked, but before the System.Web.UI.WebControls.GridView control deletes the row. This enables you to provide an event-handling method that performs a custom routine, such as canceling the delete operation, whenever this event occurs.

A System.Web.UI.WebControls.GridViewDeleteEventArgs object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the delete operation should be canceled. To cancel the delete operation, set the System.ComponentModel.CancelEventArgs.Cancel property of the System.Web.UI.WebControls.GridViewDeleteEventArgs object to true. You can also manipulate the GridViewDeleteEventArgs.Keys and GridViewDeleteEventArgs.Values collections, if necessary, before the values are passed to the data source.

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