ListView.ColumnHeaderCollection.Item[] Property

Definition

Gets a column header from the collection.

Overloads

Item[Int32]

Gets the column header at the specified index within the collection.

Item[String]

Gets the column header with the specified key from the collection.

Item[Int32]

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

Gets the column header at the specified index within the collection.

C#
public virtual System.Windows.Forms.ColumnHeader this[int index] { get; }

Parameters

index
Int32

The index of the column header to retrieve from the collection.

Property Value

A ColumnHeader representing the column header located at the specified index within the collection.

Exceptions

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

Remarks

You can use this method to obtain the ColumnHeader stored at a specific location in the collection. To determine the index of a specific column header in the collection, use the IndexOf method.

See also

Applies to

.NET Framework 4.8.1 och andra versioner
Produkt Versioner
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Item[String]

Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs
Source:
ListView.ColumnHeaderCollection.cs

Gets the column header with the specified key from the collection.

C#
public virtual System.Windows.Forms.ColumnHeader this[string key] { get; }

Parameters

key
String

The name of the column header to retrieve from the collection.

Property Value

The ColumnHeader with the specified key.

Remarks

The key comparison is not case-sensitive. If key is null or an empty string, Item[] returns null.

Applies to

.NET Framework 4.8.1 och andra versioner
Produkt Versioner
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10