Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionprivate void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (dataGridView1.Columns[e.ColumnIndex].Name == "colDateCom") { //Vérification de la valeur dans la colonne Statut if ((Int32)dataGridView1.Rows[e.RowIndex].Cells["colStatut"].Value == 1) e.CellStyle.BackColor = Color.LightGreen; else e.CellStyle.BackColor = Color.Red; } }
dataGridView1.CellFormatting += dataGridView1_CellFormatting;
if ((String)dataGridView1.Rows[e.RowIndex].Cells["statut"].Value == "1")