Problem: Want to center the text in the header of a DataGridView.
Answer:
this.dataGridView1.ColumnHeadersDefaultCellStyle.Alignment =
DataGridViewContentAlignment.BottomCenter;
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;
Answer:
Say you want to change the third column's width to 80
int index = 3;
this.dataGridView1.Columns[index].Width = 80;
Subscribe to:
Posts (Atom)