Sometimes you will want to display only some of the columns that are available in a DataGridView. For example, you might want to show an employee salary column to users with management credentials while hiding it from other users.
To hide a column programmatically
In the DataGridView control, the column's Visible property determines whether the column is displayed.
To hide a column using the designer
- Choose Edit Columns from the control's smart tag.
- Select a column from the Selected Columns list.
- In the Column Properties grid, set the Visible property to false.