Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically set column width in DataGridView

I have a DGV I am binding to a list of objects. I set AutoSizeColumnsMode to Fill, so that the columns stretch to fill the entire DGV, however, currently they stretch in a way so all columns are equal width. How can i specify a weightage so that the first column be 30% of the width and the other be 70%?

like image 808
xbonez Avatar asked Apr 08 '26 00:04

xbonez


1 Answers

Most specifically it appears to me you could use "AutoSizeColumsMode" = "Fill" and then set "FillWeight" on each Column to the % you were looking for.

like image 81
deepee1 Avatar answered Apr 10 '26 13:04

deepee1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!