Click to See Complete Forum and Search --> : column resize


coricori
July 28th, 2008, 04:45 AM
Hi there

How can I disable column resize in a DataGrid?
I'm also interested by disabling individual columns or all the columns from the grid.

Which are the alternatives?

foamy
July 28th, 2008, 06:33 AM
You can set the DataGridView's AutoSizeColumns property to False.
To disable individual columns, set their AutoSizeMode property to None:

dataGridView1.Columns["test"].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;