This documentation is archived and is not being maintained.

ListViewItem.ListViewSubItemCollection.Insert Method

Inserts a subitem into the collection at the specified index.

[Visual Basic]
Public Sub Insert( _
   ByVal index As Integer, _
   ByVal item As ListViewItem.ListViewSubItem _
public void Insert(
 int index,
 ListViewItem.ListViewSubItem item
public: void Insert(
 int index,
 ListViewItem.ListViewSubItem* item
public function Insert(
   index : int,
 item : ListViewItem.ListViewSubItem


The zero-based index location where the item is inserted.
A ListViewItem.ListViewSubItem representing the subitem to insert into the collection.


Exception Type Condition
ArgumentOutOfRangeException The index parameter is less than zero or greater than or equal to 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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

ListViewItem.ListViewSubItemCollection Class | ListViewItem.ListViewSubItemCollection Members | System.Windows.Forms Namespace | Add | AddRange