-1

Here is the screenshot of the datagridView, By using c# , how can I make disappear the grey unnecessary zone in my datagridview?

2 Answers2

2

Make reference to this post.

It seems though that this person had the exact same problem as you in some aspect and seemingly got rid of it by means of the top rated answer.

Hope it helps.

fluffy
  • 223
  • 1
  • 14
0

There are 2 Options.

Option 1:

Add this line to your Form_Load Event:

dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

Option 2:

Change the AutoSizeColumnsMode property in Datagridview to Fill

Joshua
  • 5,032
  • 2
  • 29
  • 45
Janugz
  • 1