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

Viewed 171

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.

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

Related