ListViewGroupCollection.Item[] Property

Definition

Gets or sets a ListViewGroup in the collection.

Overloads

Item[String]

Gets or sets the ListViewGroup with the specified Name property value.

Item[Int32]

Gets or sets the ListViewGroup at the specified index within the collection.

Item[String]

Source:
ListViewGroupCollection.cs
Source:
ListViewGroupCollection.cs
Source:
ListViewGroupCollection.cs

Gets or sets the ListViewGroup with the specified Name property value.

C#
public System.Windows.Forms.ListViewGroup this[string key] { get; set; }
C#
public System.Windows.Forms.ListViewGroup? this[string key] { get; set; }

Parameters

key
String

The name of the group to get or set.

Property Value

The ListViewGroup with the specified name, or null if no such ListViewGroup exists.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

Item[Int32]

Source:
ListViewGroupCollection.cs
Source:
ListViewGroupCollection.cs
Source:
ListViewGroupCollection.cs

Gets or sets the ListViewGroup at the specified index within the collection.

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

Parameters

index
Int32

The index within the collection of the ListViewGroup to get or set.

Property Value

The ListViewGroup at the specified index within the collection.

Exceptions

index is less than 0 or greater than or equal to Count.

Remarks

Use this property to retrieve the group at the specified index within the collection. When you have a reference to the group object and need the index, use the IndexOf method.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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