GridView::DeleteRow Method (Int32)
.NET Framework (current version)
Deletes the record at the specified index from the data source.
Assembly: System.Web (in System.Web.dll)
Parameters
- rowIndex
-
Type:
System::Int32
The index of the row to delete.
| Exception | Condition |
|---|---|
| HttpException | The GridView control is not bound to a data source control. |
| NotSupportedException | The data source control that the GridView control is bound to does not support delete operations, or there is no delete command defined for the data source. |
Use the DeleteRow 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 GridView control, such as from a different control on the page. Calling this method also raises the RowDeleted and RowDeleting events.
.NET Framework
Available since 2.0
Available since 2.0
Show: