Tuesday, February 24, 2009

Visual Studios 2008 - DataGridView Column Width

Problem: How to set the column width of a DataGridView in C#

Answer:

Say you want to change the third column's width to 80

int index = 3;
this.dataGridView1.Columns[index].Width = 80;

No comments: