Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Hide any or all column header in DataGridView?

I am currently working on a Windows App using C#. I have this datagridview whose first image columns are Edit and Delete. I have an issue with hiding both their headers. How can I do that, yet keep the headers of the following columns visible?

Thanks in advance.

like image 831
eddylepatio Avatar asked Feb 18 '23 01:02

eddylepatio


1 Answers

While Using C# you can write the following

this.dataGridView1.Columns["CustomerID"].Visible = false;

and to Hide all the column headings you can use:

dataGridView1.ColumnHeadersVisible = false;
like image 166
Kumar Saurabh Sinha Avatar answered Feb 20 '23 16:02

Kumar Saurabh Sinha