I have code like (this is just an example):
protected void SomeGridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[8].BackColor = System.Drawing.Color.Red;
}
} What I don't like about this is that I'm referring to the column I want by an index number. If I change the number of columns in the gridview this breaks. Is there a more robust way to refer to the column I want?
If a post helps me I'll always eventually mark it as an answer. But I frequently don't mark it right away because I feel once a thread is marked as answered, discussion tends to end. And I like to discuss things a bit.