DataGridViewColumnCollection.IList.RemoveAt(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从集合中移除具有指定索引的元素。
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
要删除的元素的位置。
实现
例外
index
小于 0 或大于控件中的列数减 1。
关联的 DataGridView 控件正在执行以下操作之一,该操作暂时禁止添加新列:
选择控件中的所有单元格。
清除选定内容。
更新列 DisplayIndex 属性值。
或 - 正在从以下 DataGridView 事件之一的处理程序调用此方法:
注解
此成员是显式接口成员的实现。 它只能在 DataGridViewColumnCollection 实例被强制转换为 IList 接口时使用。