I have a GridView with a load of data in, there is an ID associated to the data that I would not like to be visible to the users. All worked fine when all the cells were visible, but as soon as I change the ID DataBound column to false, when I try to access the item in code I get “” instead of it’s actual value (that worked perfectly when it was visible).
Is there a reason for this? If not, how should I be approaching this?
Thanks in advance,
Lloyd
For some reason, the data in hidden columns are not preserved unless the column is visible when binding to the grid. Try something like the following:
Now your column isn’t visible, but it contains your ids.