Vote count: 0
private void dataGridView1_CellFormatting_1(object sender, DataGridViewCellFormattingEventArgs e)
if (dataGridView1.NewRowIndex != e.RowIndex)
{
if (dataGridView1.Rows[e.RowIndex].Cells[9].Value <1)
{
foreach (DataGridViewCell item in dataGridView1.Rows[e.RowIndex].Cells)
{
item.Style.BackColor = Color.Red;
}
}
else if (dataGridView1.Rows[e.RowIndex].Cells[9].Value >=1)
{
foreach (DataGridViewCell item in dataGridView1.Rows[e.RowIndex].Cells)
{
item.Style.BackColor = Color.GreenYellow;
}
}
asked 47 secs ago
operator cannot be applied to operands of type object and int
Aucun commentaire:
Enregistrer un commentaire