3

I have a datagridview. I set AutoSizeColumnsMode property to Fill. However I want to set a minimum width for the columns. So, when too many columns are created, the scroll bar is shown.

How can I do this?

César
  • 9,939
  • 6
  • 53
  • 74
user983924
  • 395
  • 2
  • 10
  • 23

1 Answers1

4

You can use the DataGridViewColumn.MinimumWidth property to do it:

DataGridViewColumn^ column = dataGridView->Columns[ 1 ];
column->MinimumWidth = 40;

MSDN

Alex
  • 409
  • 5
  • 12