This documentation is archived and is not being maintained.

ListViewDeletedEventArgs Class

Provides data for the ItemDeleted event.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public class ListViewDeletedEventArgs extends EventArgs

The ListView control raises the ItemDeleted event when a Delete button in the control is clicked or the DeleteItem method is called, but after the ListView control deletes the item. (A Delete button is a button whose CommandName property is set to "Delete".) This enables you to provide an event-handling method that performs a custom routine whenever this event occurs, such as checking the results of a delete operation.

A ListViewDeletedEventArgs object is passed to the event-handling method. This object enables you to determine the number of items affected and any exceptions that might have occurred. To determine the number of items that were affected by the delete operation, use the AffectedRows property. To determine whether any exceptions occurred, use the Exception property. You can indicate whether you have handled the exception in the event-handling method by setting the ExceptionHandled property.


If an exception occurs during the delete operation and the ExceptionHandled property is set to false, the ListView control re-throws the exception.

To access the key fields of the deleted item, use the Keys property. To access non-key fields of the deleted item, use the Values property. For a list of initial property values for an instance of the ListViewDeletedEventArgs class, see the ListViewDeletedEventArgs constructor.

The following example shows how to use the ListViewDeletedEventArgs object to determine whether an exception occurred during a delete operation. The ListViewDeletedEventArgs object is passed to the event-handling method for the ItemDeleted event.

No code example is currently available or this language may not be supported.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.

.NET Framework

Supported in: 3.5