When you bind a GridView to an ObjectSource in ASP.NET, sometimes, you don't want to display all of the columns returned from the ObjectSource DataTable, but if you use a GridView and let it autmatically generate the columns, it becomes not a striaght forward deal to hide the individual selected columns. Here is a way to do that:
Simply catch the RowDataBound event on the GridView and if you know the index of the column to hide, just use it as follows: