Ayush
Ayush

Reputation: 42440

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%?

Upvotes: 2

Views: 10895

Answers (1)

deepee1
deepee1

Reputation: 13196

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

Upvotes: 10

Related Questions