DataGridViewRowCollection.IList.RemoveAt(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从集合中删除位于指定位置的 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
等于集合中的行数,并且 DataGridView 的 AllowUserToAddRows 属性设置为 true
。
- 或 -
关联的 DataGridView 控件绑定到 AllowRemove 和 SupportsChangeNotification 属性值不同时为 true
的 IBindingList 实现。
注解
此成员是显式接口成员的实现。 它只能在 DataGridViewRowCollection 实例被强制转换为 IList 接口时使用。
适用于
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈