DataGridViewCellCollection.IList.Add(Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
向集合中添加一项。
virtual int System.Collections.IList.Add(System::Object ^ value) = System::Collections::IList::Add;
int IList.Add (object value);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (value As Object) As Integer Implements IList.Add
参数
- value
- Object
要添加到集合中的 DataGridViewCell。
返回
新元素的插入位置。
实现
例外
value
不是 DataGridViewCell。
拥有此 DataGridViewCellCollection 的行已经属于某个 DataGridView 控件。
- 或 -
value
表示一个已经属于 DataGridViewRow 的单元格。
注解
将行添加到控件后,它包含的单元格数始终与控件中的列数匹配,因此此方法不再有用。
此成员是显式接口成员的实现。 它只能在 DataGridViewCellCollection 实例被强制转换为 IList 接口时使用。