DataGridViewCellCollection.Insert(Int32, DataGridViewCell) Metoda

Definice

Vloží buňku do kolekce v zadaném indexu.

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)

Parametry

index
Int32

Index založený na nule, na kterém se má umístit dataGridViewCell.

dataGridViewCell
DataGridViewCell

Vložte DataGridViewCell ho.

Výjimky

Řádek, který tento řádek vlastní, DataGridViewCellCollection už patří do DataGridView ovládacího prvku.

nebo

dataGridViewCelljiž patří do .DataGridViewRow

Poznámky

Tuto metodu použijte ke změně kolekce před přidáním obsahujícího řádku do DataGridView ovládacího prvku. Jakmile přidáte řádek do ovládacího prvku, počet buněk, které obsahuje, se vždy shoduje s počtem sloupců v ovládacím prvku, takže tato metoda už není užitečná.

Platí pro

Viz také