Header text in a datagrid
Messages   Related Types
This message was discovered on ASPFriends.com 'winforms-cs' list.


Wenfeng Gao

Hi,

By default, the column header text of a DataGrid is displayed at the top
left corner of the column header cell.
How to make it appear in the central area of the column header cell?

Thanks.

Wenfeng

Reply to this message...
 
    
Kladiva, Jay
Wenfeng,

Try setting the alignment property for each column in your
DataGridTableStyle

Ex.

oTs.GridColumnStyles(0).Alignment() = HorizontalAlignment.Center

hth,

Jay
-----Original Message-----
From: Wenfeng Gao [mailto:Click here to reveal e-mail address]
Sent: Thursday, May 09, 2002 3:40 PM
To: winforms-cs
Subject: [winforms-cs] Header text in a datagrid

Hi,

By default, the column header text of a DataGrid is displayed at the top
left corner of the column header cell.
How to make it appear in the central area of the column header cell?

Thanks.

Wenfeng

| [winforms-cs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/winforms-cs.asp = JOIN/QUIT

Reply to this message...
 
    
Scott Berry
I'm afraid there's a bug on this one: aligning right works, but aligning
center doesn't. We intend to fix this in a future release.
    -Scott

This posting is provided "AS IS" with no warranties, and confers no
rights.

-----Original Message-----
From: Kladiva, Jay [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, May 09, 2002 2:10 PM
To: winforms-cs
Subject: [winforms-cs] RE: Header text in a datagrid

Wenfeng,

Try setting the alignment property for each column in your
DataGridTableStyle

Ex.

oTs.GridColumnStyles(0).Alignment() =3D HorizontalAlignment.Center

hth,

Jay
-----Original Message-----
From: Wenfeng Gao [mailto:Click here to reveal e-mail address]
Sent: Thursday, May 09, 2002 3:40 PM
To: winforms-cs
Subject: [winforms-cs] Header text in a datagrid

Hi,

By default, the column header text of a DataGrid is displayed at the top
left corner of the column header cell.
How to make it appear in the central area of the column header cell?

Thanks.

Wenfeng

| [winforms-cs] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/winforms-cs.asp =3D JOIN/QUIT

| [winforms-cs] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/winforms-cs.asp =3D JOIN/QUIT

Reply to this message...
 
 
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid
System.Windows.Forms.DataGridTableStyle
System.Windows.Forms.HorizontalAlignment




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com