DataGridViewCellCollection.Insert(Int32, DataGridViewCell) Metod

Definition

Infogar en cell i samlingen vid det angivna indexet.

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)

Parametrar

index
Int32

Det nollbaserade index där dataGridViewCell.

dataGridViewCell
DataGridViewCell

Infoga DataGridViewCell .

Undantag

Raden som äger detta DataGridViewCellCollection tillhör redan en DataGridView kontroll.

-eller-

dataGridViewCell tillhör redan en DataGridViewRow.

Kommentarer

Använd den här metoden för att ändra samlingen innan du lägger till den innehållande raden i en DataGridView kontroll. När du lägger till raden i en kontroll matchar antalet celler som den innehåller alltid antalet kolumner i kontrollen, så den här metoden är inte längre användbar.

Gäller för

Se även