ListView.ListViewItemCollection.Remove Method (ListViewItem)


Removes the specified item from the collection.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public virtual void Remove(
	ListViewItem item


Type: System.Windows.Forms.ListViewItem

A ListViewItem representing the item to remove from the collection.

Exception Condition

The ListViewItem assigned to the item parameter is null.

When you remove an item from the collection, the indexes change for subsequent items in the collection. All information about the removed item is deleted. You can use this method to remove a specific item from the collection by specifying the actual item to remove. To specify the index of the item to remove instead of the item itself, use the RemoveAt method. To remove all items from the collection, use the Clear method.

.NET Framework
Available since 1.1
Return to top