Search code examples
c#datagridviewautosizedatagridviewcolumn

The contents of last column in a DataGridView gets squeezed instead of the just moving


I have a DataGridView with 5 columns. And the last column has AutoSizeMode set to 'Fill'. And, now when I am resizing say , I expand the second last column header towards right, a scrollbar appears but the contents in the last column are shrinking and the text starts displaying dots.

Is there is a way I can avoid the contents from getting squeezed? Is there is a way to make the last column just move towards right rather than squeezing contents (by enabling scrollbar) when I'm expanding the second last column?

I have set the AutoSizeMode to Fill only for the last column as I need that column to fill the grid.

Before expanding:

Before expanding

After expanding:

After expanding


Solution

  • Just need to set the MinimumWidth property of the last column.