ListViewGroupCollection::AddRange Method (ListViewGroupCollection^)

 

Adds the groups in an existing ListViewGroupCollection to the collection.

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

public:
void AddRange(
	ListViewGroupCollection^ groups
)

Parameters

groups
Type: System.Windows.Forms::ListViewGroupCollection^

A ListViewGroupCollection containing the groups to add to the collection.

Exception Condition
ArgumentException

groups contains at least one group with at least one ListViewItem that belongs to a ListView control other than the one that owns this ListViewGroupCollection.

Use this version of the AddRange method to add the elements of a ListViewGroupCollection that you retrieve through the ListView::Groups property of a different ListView control.

Unlike the Add method, the AddRange method does not have a return value that can be used to determine whether a group being added is already in the collection. If you need this information, use the Contains method before using the AddRange method.

.NET Framework
Available since 2.0
Return to top
Show: