DataGridViewRowCollection.IList.RemoveAt(Int32) 方法

定义

从集合中删除位于指定位置的 DataGridViewRow

 virtual void System.Collections.IList.RemoveAt(int index) = System::Collections::IList::RemoveAt;
void IList.RemoveAt (int index);
abstract member System.Collections.IList.RemoveAt : int -> unit
override this.System.Collections.IList.RemoveAt : int -> unit
Sub RemoveAt (index As Integer) Implements IList.RemoveAt

参数

index
Int32

要移除的 DataGridViewRow 的从零开始的索引。

实现

例外

index 小于零且大于集合中的行数减一。

关联的 DataGridView 控件正在执行以下操作之一,该操作暂时禁止添加新行:

  • 选择控件中的所有单元格。

  • 清除所选内容。

- 或 -

正在从以下 DataGridView 事件之一的处理程序调用此方法:

- 或 -

index 等于集合中的行数,并且 DataGridViewAllowUserToAddRows 属性设置为 true

- 或 -

关联的 DataGridView 控件绑定到 AllowRemoveSupportsChangeNotification 属性值不同时为 trueIBindingList 实现。

注解

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

适用于

另请参阅