Hi,
Use CellFormatting evetn of grid like;
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.Value != null && e.Value.Equals("something"))
{
e.CellStyle.BackColor = Color.Yellow;
e.CellStyle.SelectionBackColor = Color.Yellow;
e.CellStyle.SelectionForeColor = Color.Black;
}
else if (e.Value != null && e.Value.Equals("else"))
{
e.CellStyle.BackColor = Color.Red;
e.CellStyle.SelectionBackColor = Color.Red;
}
}