|
-
Jul 28th, 2008, 02:41 PM
#1
Thread Starter
Hyperactive Member
[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
-
Jul 28th, 2008, 02:49 PM
#2
Fanatic Member
Re: [2005] DataGridView header problem
I think that you need to set the WrapMode of the columnHeadersDefaultCellStyle to false.
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
-
Jul 28th, 2008, 03:23 PM
#3
Thread Starter
Hyperactive Member
Re: [2005] DataGridView header problem
Hi Clanguage;
Your suggestion works but I thought that
Code:
DataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnMode.AllCells)
was supposed to handle it
-
Jul 28th, 2008, 03:31 PM
#4
Fanatic Member
Re: [2005] DataGridView header problem
That would work for the columns not the Column Header I believe.
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|