Hiding a property from displaying in Datagridview in C#.NET

The below example demonstrates hiding a property of a class from displaying in Datagridview.  When you bind a class objec to datagridview with help of bindinglist, by default all properties will be displayed in datagridview.

Property name will be the column name of datagridview and each object values are displayed as one row.

If you want  to hide any property of class from displaying , you can use Browsable attribute which is present in System.ComponentModel namespace.

Please find the code snippet below for making property invisible in Datagridview.

private void Form1_Load(object sender, EventArgs e)
            BindingList<Employee> employeelist = new BindingList<Employee>();

            Employee employee01 = new Employee { EmpID = 1000, EmployeeName = "John", EmployeeLocation = "Bristol" };
            Employee employee02 = new Employee { EmpID = 1000, EmployeeName = "John", EmployeeLocation = "Bristol" };
            Employee employee03 = new Employee { EmpID = 1000, EmployeeName = "John", EmployeeLocation = "Bristol" };


            dataGridView1.DataSource = employeelist;


    public class Employee
        public int EmpID

        public string EmployeeName

        //The below property will  not be visible in Datagridview or in properties window
        public string EmployeeLocation

When you assign above datatable to Datagridview, the data in Datagridview looks as below

.NET Winforms TextBox AutoComplete

Zooming in Winforms Webbrowser Control in .NET
Filtering Datatable with Select Conditions and Sorting in C#.NET
Logic to detect if Application is started from Citrix/Terminal Server/PC in C#
Winforms Application.DoEvents Method
Modify XML file with tagname in c#.net
Read Machine IP Address in C#
Check if IIS is running using C#
Implementing IEnumerable in C#
Built in Delegates in .NET Framework
Changing Winform webbrowser control IE version in C#.NET
Set the dropdown width of any combobox based on the data
Difference between Const and ReadOnly
Example for Property Change Notification in C#.NET
Example Program using Delegates and Events in C#
AutoComplete in .NET Winforms TextBox
How to read data from XML String and insert in to table in SQL Server
WebBrowser.navigate Data Submission by Get or Post Methods
Datagridview Paging
Copy Datagridview cell value using ContextMenu
Inserting data in Datatable in C#
Cookie in .NET
Using Control's Child Index and Dock property for achieving desired layout in a form.
Accessing section group inside configuration of web.config
Create File in .NET C#
Change button shape in .net
Dispose vs Finalize in .net

Hiding a property from displaying in Datagridview, Browsable attribute, Hide column in Daagridview, Hide a property in c#