I'd go for a TemplateControl by default in this scenario. What line throws that error? If it where referencing the wrong column I'd expect to see an IndexOutOfRange exception. StackOverflow is a bit odd in this case...
Eh... you said it was fine unless you were in edit mode. How did you hit GridView1.Columns(11).Visible = False if e.Row.RowState was Edit, as it should be when your "edit button" is clicked? Are you SURE the error is occurring where you think it is?
You're missing something here...
Also, (assuming I didn't use a TemplateControl) I'd be inclined to do this check in the grid's DataBound event instead. There's no need to set the column visibility to false multiple times.
Well I did try your suggestions howerver nothing worked. I think next time I will manually create the Table and writ ethe code rathe rthan use the Gridview for this tyoe of situation. With that said here is what i did.
1. Convert the column to a template
2. The columns that I want to hide - site the width to 0
3. In the ItemTemplate just remove the text so that the column title is is blank
4. On the ASP: Code set GridLines = None
5. In the edit template Put the text/check box you want to use
Doing the above steps allowed me to hide the columns in "Normal mode" and have them show in edit mode.