简体   繁体   中英

How to resize a Data Grid View Column size

i want to resize c# data grid view column to a custom size. how i can do this?

Set the DataGridViewColumn.Width Property .

You can do this either in the Visual Studio Designer or through code:

DataGridViewColumn column = dataGridView.Columns[0];
column.Width = 60;

You should be aware that the DataGridViewColumn.AutoSizeMode Property setting can affect a column's width too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM