Export (0) Print
Expand All

ListViewGroupCollection.CopyTo Method

Copies the groups in the collection to a compatible one-dimensional Array, starting at the specified index of the target array.

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

public void CopyTo(
	Array array,
	int index


Type: System.Array

The Array to which the groups are copied.

Type: System.Int32

The first index within the array to which the groups are copied.


ICollection.CopyTo(Array, Int32)

Use the CopyTo method to copy the groups in a collection (including the item references they contain) to a compatible array, starting at a specified index. This is useful, for example, when you want to sort the groups in the collection using the Array.Sort method. To do this, copy the groups into a compatible array, then sort the array. Next, use the Clear method to remove all the groups from the collection, then use the AddRange method to add the sorted array back to the collection.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

© 2014 Microsoft