[2005] DataGridView header problem
Hi All;
I am using the datagridview to display information from a database table.
I use the following code to set the header and then set the column size...
Code:
DataGridView1.Columns("ORDER_NBR").HeaderCell.Value = "Order Number"
DataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnMode.AllCells)
In the grid column I see
Order
Number
instead of
Order Number
Does anyone know why this is happening?
Thanks
Lin
Re: [2005] DataGridView header problem
I think that you need to set the WrapMode of the columnHeadersDefaultCellStyle to false.;)
Re: [2005] DataGridView header problem
Hi Clanguage;
Your suggestion works but I thought that
Code:
DataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnMode.AllCells)
was supposed to handle it:ehh:
Re: [2005] DataGridView header problem
That would work for the columns not the Column Header I believe.;)