این کد تمام ردیف هایی که مقدار 2 داخلشون هست رو رنگی میکنه، شما به جای 2 عدد 45 بذارین
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
for (int j = 0; j < this.dataGridView1.Rows[i].Cells.Count; j++)
{
if (e.Value != null)
{
string CNumColour = e.Value.ToString();
if (CNumColour == "2")
{
this.dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Aqua;
}
}
}
}
}