开发者

How can I make a Winforms datagridview expand column widths to fit content?

开发者 https://www.devze.com 2023-02-22 15:50 出处:网络
I need my开发者_如何学Python columns to be only as big as the largest value in that column. Is there a setting somewhere I can set?

I need my开发者_如何学Python columns to be only as big as the largest value in that column.

Is there a setting somewhere I can set?

Thank you.


You can set the AutoSizeColumnsMode property to DataGridViewAutoSizeColumnsMode.AllCells (or the appropriate value for you). Or call AutoResizeColumns() to resize the columns as you need it.

0

精彩评论

暂无评论...
验证码 换一张
取 消