ListViewItem.ListViewSubItemCollection.Insert Method (Int32, ListViewItem.ListViewSubItem)

 
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.

Inserts a subitem into the collection at the specified index.

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

public void Insert(
	int index,
	ListViewItem.ListViewSubItem item
)

Parameters

index
Type: System.Int32

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

item
Type: System.Windows.Forms.ListViewItem.ListViewSubItem

A ListViewItem.ListViewSubItem representing the subitem to insert into the collection.

Exception Condition
ArgumentOutOfRangeException

The index parameter is less than zero or greater than the value of the Count property of the ListViewItem.ListViewSubItemCollection.

This method allows you to insert a subitem at a specific position in the ListViewItem.ListViewSubItemCollection. To add a subitem without specifying a specific position, use the Add method. If you want to add an array of subitems to the collection, use the AddRange method. You can use this method if you want to insert a new subitem into an existing collection of subitems.

.NET Framework
Available since 1.1
Return to top
Show: