If you are using a datagrid in a web form, the DataGridColumn(s) have a Visible property. Use the DataGrid.DataGridColumn().Visible property to programmatically control whether the column is visible in the DataGrid control.
However, from your email, I expect you are asking about dataGrids in Windows Forms which does *not* have this rather handy property. I have only been able to control the content by changing the dataset or SQL query which fills the set.
DataGrids for Windows Forms seem to use the model that you have to create a "view" of the data that you want to display by manipulating the underlying dataset or a datatable. This is probably what you were trying to avoid.
---
dino
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.