ListView::ColumnHeaderCollection::Insert Method (Int32, ColumnHeader^)

 

Inserts an existing column header 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,
	ColumnHeader^ value
)

Parameters

index
Type: System::Int32

The zero-based index location where the column header is inserted.

value
Type: System.Windows.Forms::ColumnHeader^

The ColumnHeader to insert into the collection.

Exception Condition
ArgumentOutOfRangeException

index is less than 0 or greater than or equal to the value of the Count property of the ListView::ColumnHeaderCollection.

This version of the Insert method enables you to insert an existing ColumnHeader at a specific position in the ListView::ColumnHeaderCollection.

If you want to create a new ColumnHeader and insert it at a specific position in the collection, use the other version of the Insert method. To add a column header without specifying a specific position in the collection, use the Add method. If you want to add an array of column headers to the collection, use the AddRange method.

.NET Framework
Available since 1.1
Return to top
Show: