lorgnettesolutions
asked on
Hide autogenerated columns in gridview after gridview rowcommand button click
I have a gridview in which I have 4 defined columns with buttons in them and 3 autogenerated columns. When I click the button in gv.column(1) I would like to make gv.column(5).visible = false
however when I do this in the gv_rowcommand private sub, I get the following error:
Index out of range. Must be non-negative and less than the size of the collection.
Can anyone help me hide the fifth column successfully?
however when I do this in the gv_rowcommand private sub, I get the following error:
Index out of range. Must be non-negative and less than the size of the collection.
Can anyone help me hide the fifth column successfully?
Does it work if you hide column in page load after binding the grid?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I did a work around to resolve my problem. Thanks
So for 5th column you should do: gv.columns(4).Visible=fals