ShirazITCo
ShirazITCo

Reputation: 1041

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?

Upvotes: 1

Views: 12646

Answers (1)

Jay Riggs
Jay Riggs

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

Related Questions