DataGrid: Can I use two text lines in the header ?

  • Thread starter Thread starter Heinz Z.
  • Start date Start date
H

Heinz Z.

Hello,

I have some boolean columns in my datagrid. To minimized the column width I
want to change the height of the header row and write the header text in two
lines.
Is this possible ?
How can I do that ?


Thank you

Heinz
 
It is possible.

First set the HeaderText for the columns in code, eg

dataGridBoolColumn1.HeaderText = "Line 1\nLine 2\nLine 3";

Next, set the dataGrid1.HeaderFont to a larger font. This increases the
height of the Headers, but the Headers are still displayed using the
dataGrid1.TableStyles[ 0 ].HeaderFont font.

Regards,
Phil.
 
Thank you,
now it runs perfectly.

Regards,
Heinz


Phil Williams said:
It is possible.

First set the HeaderText for the columns in code, eg

dataGridBoolColumn1.HeaderText = "Line 1\nLine 2\nLine 3";

Next, set the dataGrid1.HeaderFont to a larger font. This increases the
height of the Headers, but the Headers are still displayed using the
dataGrid1.TableStyles[ 0 ].HeaderFont font.

Regards,
Phil.

Heinz Z. said:
Hello,

I have some boolean columns in my datagrid. To minimized the column width I
want to change the height of the header row and write the header text in two
lines.
Is this possible ?
How can I do that ?


Thank you

Heinz
 
Back
Top