User cannot resize columns of DataGridView

I have a DataGridView with a data source set to a data binding source. My problem is that I cannot change most of the columns. Some columns do not show the resize cursor, while two others: you can resize, not.

Here is what I tried:

  • DGV.AllowUsertoResizeColumns = True
  • DGV.AutoSizeColumnMode = None
  • DGV.RowHeadersWidthSizeMode = EnableResizing
  • DGV.Dock = Fill
  • All columns having AutoSizeMode = NoneSet and Resizable = True
  • DGV is built into the SplitContainer panel, but after being brought to the foreground, the rest back or other random combinations still cannot resize
  • Using dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader) (and other changes) after loading data into DGV
  • While I can resize one of the columns, the settings in the Columns collection are the same.

Here is a screenshot of the properties of my DataGridView :

DataGridView Properties

Any ideas?

+8
datagridview
source share
1 answer

After checking individual column parameters in gridview, I found that some cells still have

AutoSizeMode = AllCells

I changed this to:

AutoSizeMode = NotSet

and now I can resize all columns.

+5
source share

All Articles