DataGridView : CellContentDoubleClick ne fonctionne pas comme prévu
Bonjour à tous,
J'ai actuellement un problème de DataGridView. Je m'explique :
J'ai une DGV qui contient des infos (id, nom, prenom, heure creation, ... ) et j'ai une méthode pour le CellContentDoubleClick qui récupere les informations de la ligne et remplis les champs automatiquement.
Par exemple : j'ai 3 textBox (tb_id, tb_nom, tb_prenom) et un datepicker (dp_creation) et a chaque double click sur une cellule du tableau, toute la ligne est récupérée et tb_id,tb_nom,tb_prenom et dp_creation se remplissent automatiquement.
Le problème ? Tout fonctionne a condition de cliquer sur la cellule de la date ou sur une cellule contenant une combobox... les autres ne font rien
Voici le code de ma methode :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
private void DGV_Planning_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
this.TB_ID.Text = DGV_Planning.Rows[e.RowIndex].Cells[0].Value.ToString();
this.TB_IDDEMANDE.Text = DGV_Planning.Rows[e.RowIndex].Cells[1].Value.ToString();
this.TB_IDINTERVIENT.Text = DGV_Planning.Rows[e.RowIndex].Cells[2].Value.ToString();
this.DT_HD.Text = DGV_Planning.Rows[e.RowIndex].Cells[3].Value.ToString();
this.DT_HF.Text = DGV_Planning.Rows[e.RowIndex].Cells[4].Value.ToString();
this.TB_COM.Text = DGV_Planning.Rows[e.RowIndex].Cells[5].Value.ToString();
this.TB_VR.Text = DGV_Planning.Rows[e.RowIndex].Cells[6].Value.ToString();
this.TB_Statut.Text = DGV_Planning.Rows[e.RowIndex].Cells[7].Value.ToString();
} |
Merci d'avance pour votre aide