DataGridViewCellCollection.Insert(Int32, DataGridViewCell) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将单元格插入集合中的指定索引处。
public:
virtual void Insert(int index, System::Windows::Forms::DataGridViewCell ^ dataGridViewCell);
public virtual void Insert(int index, System.Windows.Forms.DataGridViewCell dataGridViewCell);
abstract member Insert : int * System.Windows.Forms.DataGridViewCell -> unit
override this.Insert : int * System.Windows.Forms.DataGridViewCell -> unit
Public Overridable Sub Insert (index As Integer, dataGridViewCell As DataGridViewCell)
参数
- index
- Int32
要放置 dataGridViewCell的从零开始的索引。
- dataGridViewCell
- DataGridViewCell
要 DataGridViewCell 插入的。
例外
拥有此权限 DataGridViewCellCollection 的行已属于控件 DataGridView 。
-或-
dataGridViewCell 已经属于一个 DataGridViewRow。
注解
在向控件添加包含行 DataGridView 之前,请使用此方法更改集合。 将行添加到控件后,它包含的单元格数始终与控件中的列数匹配,因此此方法不再有用。