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?

Upvotes: 0

Views: 372

Answers (2)

Set the DataGridView property RowHeadersVisible to false.

Upvotes: 0

Gonzalo.-
Gonzalo.-

Reputation: 12682

Try to set property RowHeaderVisible in False

yourDgv.RowHeadersVisible = false;

Upvotes: 1

Related Questions