Editable columns of a DataGridView, but the last column can no longer be changed?

  For c = 0 To grd.Columns.Count - 1
     grd.Columns (c) .Resizable = DataGridViewTriState.True
 Next c

This allows me to change all the columns in my DataGridView. EXCLUDE the last column. What for? I get a small mouse variable ... but you can only make a SMALLER column, not a WIDER.

(Same problem if I try to set all columns to Resizable using VB.net environment)

What am I doing wrong here? Can't I resize any column I want larger or smaller?

+6
source share
2 answers

You cannot make the last column wider because it already fills all the available space in the control!

Unlike other columns in the middle that simply steal space from a column to the right, there is no column to the right of the last column from which it should steal space. Since it has nowhere to go, the control simply does not allow you to resize the last column.

+1
source

I had the same problem - I could not resize the last column in the DataGridView (the resizable property was set to "True"). I had the Fill mode set to Display Cells. When I changed this setting to Not Set, I can resize the last column.

0
source

Source: https://habr.com/ru/post/887724/


All Articles