I have autogenerated columns here from visitid and so on. The first column however was a templatefield. now I wanted to hide VisitID. I tried this code but it didn’t work. I am using vb as my codebehind
e.Row.Cells(1).Visible = False

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have tried several ways but also ended with this code and it worked finally I just added a condition. I’m sorry maybe I lacked information. I had a pagination in the gridview.. Here was my working code.
At first it was “….cells.count < 0” and that didn’t work the index was still out of range but when I changed it to 1. It worked. I think the pagination has something to do with it. I’m not sure though… Thank you for all the help