ListView::ListViewItemCollection::IList::Insert Method (Int32, Object^)

 

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)

private:
virtual void Insert(
	int index,
	Object^ item
) sealed = IList::Insert

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: