Imar:
In your book (Page 530) you say "Additionally, you can tweak these controls to hide specific columns, ...".
I have had no luck hiding columns in a GridView. I have tried adding
Code:
e.Row.Cells[0].Visible=false;
to the RowCreated event but this results in the column not being rendered.
Several blogs talk about the fact that Microsoft decided (starting with Visual Studio 2008) that hiding columns was a security risk at no longer renders any cell that is marked as "visible = false" and consequently the data in that column is not hidden - it is deleted!
One blog suggests that you can set "itemstyle-css" to a "hiddencol" attribute that you define in a style sheet as "display: none;". To do this with a databound GridView you need to set autogeneratecolumns to false so that you can add the "itemstyle-css" to each BoundField in Markup view. However, this does not work.
Do you have any suggestions? Is it possible if I use a ListView instead?