System.Web.UI.WebControls.GridView.DeleteRow Method

Deletes the record at the specified index from the data source.

Syntax

public virtual void DeleteRow (int rowIndex)

Parameters

rowIndex
The index of the row to delete.

Remarks

Use the GridView.DeleteRow(int) method to programmatically delete the record at the specified index from the data source. This method is commonly used when you need to delete a record from outside of the System.Web.UI.WebControls.GridView control, such as from a different control on the page. Calling this method also raises the GridView.RowDeleted and GridView.RowDeleting events.

Requirements

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