Export (0) Print
Expand All

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 _
)
[C#]
public void Insert(
 int index,
 ListViewItem.ListViewSubItem item
);
[C++]
public: void Insert(
 int index,
 ListViewItem.ListViewSubItem* item
);
[JScript]
public function Insert(
   index : int,
 item : ListViewItem.ListViewSubItem
);

Parameters

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

Exceptions

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.

Remarks

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.

Requirements

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

Show:
© 2014 Microsoft