My GridView (ASP.NET Visual Studio 2005) has both DataBound and non-DataBound fields.
I want to change the BackColor of each row to something unique and do this in the RowDataBound event.
It works perfectly if I remove all TemplateFields from the GridView, otherwise nothing happens.
I don't get an error, it simply does not change the BackColor of the rows.
As you can see in the appended code I choose to pick the color from a databound field, this has nothing to do with the problem though as I have tried setting the color by e.g. Color.Red and that does not work either with the TemplateField.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
string color = e.Row.Cells.Text;
e.Row.BackColor = Color.FromName(color);