I am assuming that you are using ASP.Net C#.
Create GridView1_RowDataBound event for your GridView.
if (e.Row.RowType = DataControlRowType.DataRow)
{
If(Condition True)
{
e.Row.BackColor = Drawing.Color.Red
}
}
For windows application:
void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.Value != null)
{
if (e.Value.Equals(string.Empty))
e.CellStyle.BackColor = Color.Green;
else
e.CellStyle.BackColor = Color.Blue;
}
}