Hi,
As Richard also suggested (and if my understanding is correct this time): set AutoGenerateColumns to false and dynamically add your columns based on what you have in the datatable.
Cosmin
Thanks first for your response.
But you might misunderstand my question:
1), The datagrid's column is generated in runtime not in design time, because the columns is depone the pre-page's search condition. only in runtime, when I construct the dataTable, I can know how many columns in the datagrid.
2) I can not access the auto-generated columns (when I debug, it should the datagrid.columns.count=0 ), then I can not set the column's visible value;
Any other help is very appreciated!
Hi,
You could use DataGridColumn's Visible property.
Cosmin