I have aq gridview with Autogeneratecolumns="True".
I want to hide some columns on databound so I have this:
Sub gvOnDataItemBound(ByVal sender As Object, ByVal e As System.EventArgs)
GridView1.Columns.Item(2).Visible = False
This gives me the error: "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index "
Why ? is it because of Autogenerate="True"?