Reputation: 1041
i want to resize c# data grid view column to a custom size. how i can do this?
Upvotes: 1
Views: 12646
Reputation: 53593
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.
Upvotes: 3