
One of the frequently asked questions over at the ASPAlliance Lists is: "How do I hide a column in a datagrid?". One very important point to note is that you cannot hide autogenerated columns in a data grid. The reason for this is that autogenerated columns are not added to the DataGrid's DataGridColumn collection. So, in order for a column to be hidden it must be either programmatically added to the DataGrid at runtime or explicitly defined (using templates) at design time with the AutoGenerateColumns property set to false (the code in this article will use this method).This article provides sample code to hide a column (could easily be mod..
|