This documentation is archived and is not being maintained.

ListView.ColumnHeaderCollection.Insert Method (Int32, String, String, Int32, HorizontalAlignment, Int32)

Note: This method is new in the .NET Framework version 2.0.

Creates a new column header with the specified aligned text, key, width, and image index, and inserts the header into the collection at the specified index.

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

public void Insert (
	int index,
	string key,
	string text,
	int width,
	HorizontalAlignment textAlign,
	int imageIndex
public void Insert (
	int index, 
	String key, 
	String text, 
	int width, 
	HorizontalAlignment textAlign, 
	int imageIndex
public function Insert (
	index : int, 
	key : String, 
	text : String, 
	width : int, 
	textAlign : HorizontalAlignment, 
	imageIndex : int



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


The name of the column header.


The text to display in the column header.


The initial width, in pixels, of the column header.


One of the HorizontalAlignment values.


The index of the image to display in the column header.

To add a column header without specifying a 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.

The Name property corresponds to the key for a column in the ListView.ColumnHeaderCollection.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0