|
Programmatically Hiding Auto-Generated Columns by Name
By:
Patrick Philippot
|
Created: 2003-05-16
|
Last Updated: 2003-05-17
|
Printer-Friendly Version
This FAQ examines how to programmatically hide a DataGridColumn when the DataGrid's columns are automatically generated (that is,
the DataGrid's
I first thought this was an easy task. My mistake. Since a lot of people seem to have had the same problem, here's the solution that I found. This workaround assumes that you know the name of the column(s) that you want to hide. Remember that you can't access an auto-generated column directly by name in a Web form DataGrid. You can get control on the columns visibility if you set AutoGenerateColumns to False but in many cases, this is neither possible nor wanted. Here we go...
The documentation states that the column order in the DataGrid is the same
as in the underlying
It is assumed here that the |
Home | FAQs | Articles | About | My Blog | Buy the Book!
Copyright 2006, Scott Mitchell. All Rights Reserved.