Home > Software design >  How to remove automatically generated empty column in a WinForms DataGrid?
How to remove automatically generated empty column in a WinForms DataGrid?

Time:12-30

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.

CodePudding user response:

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