DataGridViewCellCollection.IList.Item[Int32] 属性

定义

获取或设置指定索引处的元素。

property System::Object ^ System::Collections::IList::Item[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
object System.Collections.IList.Item[int index] { get; set; }
object? System.Collections.IList.Item[int index] { get; set; }
member this.System.Collections.IList.Item(int) : obj with get, set
 Property Item(index As Integer) As Object Implements IList.Item

参数

index
Int32

要获取或设置的项的索引。

属性值

指定索引处的 DataGridViewCell

实现

例外

当设置此属性时,指定的值不是 DataGridViewCell

当设置此属性时,指定的值为 null

设置此属性时,指定的单元格已经属于某个 DataGridView 控件。

- 或 -

设置此属性时,指定的单元格已经属于某个 DataGridViewRow

index 小于 0。

- 或 -

index 大于或等于集合中的单元格数。

注解

此成员是显式接口成员的实现。 它只能在 DataGridViewCellCollection 实例被强制转换为 IList 接口时使用。

适用于

另请参阅