<p>I have a DataGridView which shows the content of a DataTable.</p>

<p>I want to set the backcolor of a row based on the value of a cell in this row.</p>

<p>Note that the cell in question is in a column which is not displayed in the DataGridView (Visible=False).</p>

If you handle the RowDataBound event you can check the value of the data and modify the attributes of the cell or apply a different style in that event handler.
```
```
protected void Page_Load(object sender, EventArgs e)
{
    GridView g1 = new GridView();
    g1.RowDataBound += new GridViewRowEventHandler(g1_RowDataBound);
}

void g1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if(e.Row.RowType == DataControlRowType.DataRow)
    {
        // Check the Value
        if(e.Row.Cells[1].Text = someValue)
        {
            e.Row.Cells[1].CssClass = "colorCellRed";
        }

    }
}
```
```
That should give you what you are looking for.  Let me know if you need it in VB rather than C#.
Good Luck!