I have a gridview I am populating it by creating a datatable filling that table from my database connection then binding the data to my grid. I am not using the autogenerate columns but I am using autogenerate select. Searching through SO I found this suggestion.
gridview.Columns[index].Visible=false;
when I added this line I get an index out of range exception thrown when i click the button in my web application.
I used that line after I bound my DataTable to the GridView but I want to hide a row to be used for a different purpose so I need to keep that information from my stored proc.
I also tried manually adding the columns with the <columns>
option but it just adds the columns on top of the existing ones.
I am a little new to web programming and taking out the autogenerate select is an option but doesn't help me as much as I would have to spend a lot of time learning to recode the select row feature of the table i dont have. Everything I have read so far has dealt with the autogenerate column problem but I am not using it and if the autogenerate select causes the same issue. I might have no choice.