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

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
 
G

Guest

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.
 
H

Heinz Z.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top