DataGridViewCellCollection.Insert(Int32, DataGridViewCell) Méthode

Définition

Insère une cellule dans la collection à l’index spécifié.

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)

Paramètres

index
Int32

Index de base zéro auquel placer dataGridViewCell.

dataGridViewCell
DataGridViewCell

À DataGridViewCell insérer.

Exceptions

Ligne qui possède cette DataGridViewCellCollection propriété appartient déjà à un DataGridView contrôle.

- ou -

dataGridViewCell appartient déjà à un DataGridViewRow.

Remarques

Utilisez cette méthode pour modifier la collection avant d’ajouter la ligne contenante à un DataGridView contrôle. Une fois que vous avez ajouté la ligne à un contrôle, le nombre de cellules qu’il contient correspond toujours au nombre de colonnes dans le contrôle. Cette méthode n’est donc plus utile.

S’applique à

Voir aussi