I have a SQL databound GridView that has a field in it that I want to make hidden at runtime, but be able to access its value throughout the program. I understand that setting Visible to true at design time (using the builder) will not bind the field. I looked around and was under the impression that the code I've included would do it. If I set Cells to anything but 0, I get an "ArgumentOutOfRangeExcepti
on". Setting it to "0" will hide the "Select" cell. The column I want to hide is #13. What gives?
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
// hide the Order ID
e.Row.Cells.Visible = false;