Search code examples
c#winformsdynamicdatagridviewdatagridviewcolumn

How can I remove "Column -1" from my DataGridView?


I'm dynamically creating the columns and rows of my DGV, and then populating the cells with the appropriate values.

Even though at present the contents are too large for the DataGridView (I set ScrollBars to None), my first column is offset to the right, with a black strip there where column 0 should be. What property removes this intruder?


Solution

  • Try to set property RowHeaderVisible in False

    yourDgv.RowHeadersVisible = false;