Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove automatically generated empty column in a WinForms DataGrid?

So I am using a DataGrid in WinForms, and whenever I load into my application I get an empty blank column. Its causing all kinds of design problems, so I want to remove it. How?

It looks like this: Example image

I am creating the columns programmatically when the form loads. Is the part of the problem? Its also not showing this on the designer page.

I am using visual studio 2019 and C# WinForms.

like image 392
James Ashwood Avatar asked Oct 14 '25 22:10

James Ashwood


1 Answers

Using @adv12's comment, I was able to find this thread. I found this column is called a "row header" using this I could disable it by going Properties > RowHeadersVisible and turning it into False (this.dataGridView1.RowHeadersVisible=false;)

Properties Changes

like image 77
James Ashwood Avatar answered Oct 17 '25 12:10

James Ashwood



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!