ListView::DeleteItem Method
Deletes the record at the specified index from the data source.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Parameters
- itemIndex
- Type: System::Int32
The index of the item to delete.
| Exception | Condition |
|---|---|
| InvalidOperationException | itemIndex is less than 0. -or- The DataSourceView object that is associated with the ListView control is nullptr. |
Use the DeleteItem method to programmatically delete the record at the specified index from the data source. This method is typically used to delete a record from outside the ListView control, such as from a different control on the page. This method raises the ItemDeleted and ItemDeleting events.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.