DataGridViewSelectedColumnCollection.ICollection.CopyTo(Array, Int32) 方法

定义

从指定索引处开始,将集合中的元素复制到指定的数组。Copies the elements of the collection to the specified array, starting at the specified index.

 virtual void System.Collections.ICollection.CopyTo(Array ^ array, int index) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo (Array array, int index);

参数

array
Array

作为集合中元素的复制目标位置的一维数组。The one-dimensional array that is the destination of the elements copied from the collection. 该数组的索引必须从零开始。The array must have zero-based indexing.

index
Int32

数组中开始复制的位置的索引(从零开始)。The zero-based index in the array at which copying begins.

实现

异常

arraynullarray is null.

index 小于零。index is less than zero.

array 是多维的。array is multidimensional.

-or- DataGridViewCellCollection 中的元素个数大于 indexarray 末尾之间的可用空间。The number of elements in the DataGridViewCellCollection is greater than the available space from index to the end of array.

DataGridViewColumnCollection 无法自动强制转换为 array 类型。The DataGridViewColumnCollection cannot be cast automatically to the type of array.

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 DataGridViewSelectedColumnCollection 实例被强制转换为 ICollection 接口时使用。It can be used only when the DataGridViewSelectedColumnCollection instance is cast to an ICollection interface.

适用于

另请参阅