Another option would be to use the CellFormatting event.
First option shows accessing the bound data item and is useful if you don't have a column set up for the data in question. Second option works if there is a column whether it is visible or not.
private void dataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (((MyDataObject)dataGridView.Rows[e.RowIndex].DataBoundItem).Condition == Value)
{
e.CellStyle.BackColor = System.Drawing.Color.Gold;
}
}
// Option two -- can use ColumnIndex instead of ColumnName
private void dataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (dataGridView["ColumnName", e.RowIndex].Value).Condition == TargetValue)
{
e.CellStyle.BackColor = System.Drawing.Color.Gold;
}
}