Jazyk

DataGridViewCellCollection.Add(DataGridViewCell) Metoda

Definice

Přidá do kolekce buňku.

public:
 virtual int Add(System::Windows::Forms::DataGridViewCell ^ dataGridViewCell);
public virtual int Add(System.Windows.Forms.DataGridViewCell dataGridViewCell);
abstract member Add : System.Windows.Forms.DataGridViewCell -> int
override this.Add : System.Windows.Forms.DataGridViewCell -> int
Public Overridable Function Add (dataGridViewCell As DataGridViewCell) As Integer

Parametry

dataGridViewCell
DataGridViewCell

A DataGridViewCell , která se má přidat do kolekce.

Návraty

Pozice, do které chcete vložit nový prvek.

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 DataGridViewRow použijte k naplnění buněk před přidáním řá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é