Skip to main content

There are situation when you would like to show only some of the columns that are available in a DataGridView on your form. E.g. a DataGridView could display contact information to system administrators, but for every other user else these information would be hidden.

- Advertisement -

How to hide a column programmatically

The Visible property of the column in the DataGridView control determines if the column can be displayed or not.

In order to hide a column in the designer following the steps below:

1) Select Edit Columns from the control's smart tag

2) Choose a column from the Selected Columns list

3) Configure the Visible property to have value "false" in the "Column Properties" grid

- Advertisement -