System.Windows.Forms.ListViewGroupCollection.Add Method

Adds the specified System.Windows.Forms.ListViewGroup to the collection.

Syntax

public int Add (ListViewGroup group)

Parameters

group
The System.Windows.Forms.ListViewGroup to add to the collection.

Returns

The index of the group within the collection, or -1 if the group is already present in the collection.

Remarks

Use this method to add an existing System.Windows.Forms.ListViewGroup to the collection. You cannot add a System.Windows.Forms.ListViewGroup to the collection more than once. When you call the ListViewGroupCollection.Add(ListViewGroup) method using a System.Windows.Forms.ListViewGroup that is already in the collection, the addition fails and -1 is returned.

To add multiple groups to the collection, use the ListViewGroupCollection.AddRange(ListViewGroup[]) method.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0