ListView.ListViewItemCollection.IList.Insert Method (Int32, Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

This API supports the product infrastructure and is not intended to be used directly from your code.

Inserts an object into the collection at the specified index.

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

void IList.Insert(
	int index,
	object item
)

Parameters

index
Type: System.Int32

The zero-based index location where the item is inserted.

item
Type: System.Object

The object that represents the item to insert.

Exception Condition
ArgumentOutOfRangeException

The index parameter is less than 0 or greater than the value of the Count property of the ListView.ListViewItemCollection.

The item parameter can be any type. If item is a ListViewItem, it is added to the ListView.ListViewItemCollection. If item is another type, a new ListViewItem is created containing the string from the ToString method of item.

.NET Framework
Available since 1.1
Return to top
Show: