System.Web.UI.WebControls.GridViewDeleteEventArgs Class

Provides data for the GridView.RowDeleting event.

See Also: GridViewDeleteEventArgs Members

Syntax

public class GridViewDeleteEventArgs : System.ComponentModel.CancelEventArgs

Remarks

The System.Web.UI.WebControls.GridView control raises the GridView.RowDeleting event when a Delete button is clicked, but before the System.Web.UI.WebControls.GridView control deletes the record. (A Delete button is a button control whose CommandName property is set to "Delete".) You can perform a custom routine whenever this event occurs, such as canceling the delete operation.

A System.Web.UI.WebControls.GridViewDeleteEventArgs object is passed to the event handler. This enables you to determine the index of the row being deleted and to cancel the delete operation. 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 before the values are passed to the data source.

For more information about how to handle events, see Consuming Events.

For a list of initial property values for an instance of System.Web.UI.WebControls.GridViewDeleteEventArgs, see the GridViewDeleteEventArgs.#ctor(int) constructor.

Requirements

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