Language

ListViewDeletedEventArgs Class

Definition

Provides data for the ItemDeleted event.

public ref class ListViewDeletedEventArgs : EventArgs
public class ListViewDeletedEventArgs : EventArgs
type ListViewDeletedEventArgs = class
    inherit EventArgs
Public Class ListViewDeletedEventArgs
Inherits EventArgs
Inheritance
ListViewDeletedEventArgs

Examples

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.

<%@ Page language="C#" %>
    

    



  
    ListViewDeletedEventArgs Example
  
  
    

ListViewDeletedEventArgs Example


<%@ Page language="VB" %>
    

    



  
    ListViewDeletedEventArgs Example
  
  
    

ListViewDeletedEventArgs Example


Remarks

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.

Note

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.

Constructors

Name Description
ListViewDeletedEventArgs(Int32, Exception)

Initializes a new instance of the ListViewDeletedEventArgs class.

Properties

Name Description
AffectedRows

Gets the number of rows that were affected by the delete operation.

Exception

Gets the exception, if any, that was raised during the delete operation.

ExceptionHandled

Gets or sets a value that indicates whether an exception that was raised during the delete operation was handled in the event handler.

Keys

Gets the key or keys for the deleted item.

Values

Gets the non-key field values for the deleted item.

Methods

Name Description
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also