This is a migrated thread and some comments may be shown as answers.

How to display DataGrid Column header in 2 lines?

5 Answers 483 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Suresh
Top achievements
Rank 1
Suresh asked on 15 Jul 2016, 03:58 AM

Hi,

I am developing a windows store 8.1 app. In my app I have a requirement to display the column header in two lines. How can I achieve this?

Thank you.

5 Answers, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 20 Jul 2016, 07:27 AM
Hello,

Thank you for your interest.

The RadDataGrid does not support displaying headers in two rows. Any other customizations are available through the HeaderStyle property.

Let me know should you need further assistance.

Regards,
Ivaylo Gergov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Suresh
Top achievements
Rank 1
answered on 25 Jul 2016, 05:02 AM

Hi,

I have tried HeaderStyle property, but I am unable to make it, could you please help me solving the issue.

Thank you.

0
Ivaylo Gergov
Telerik team
answered on 28 Jul 2016, 05:18 AM
Hi,

As i noted before, if you want to simulate two grid rows, this would not be possible. If the scenario is different, please send me some screenshot of the desired result.

Regards,
Ivaylo Gergov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Suresh
Top achievements
Rank 1
answered on 28 Jul 2016, 06:18 AM

Hi,

I want to display the column header text in tow lines. If i set the width to the column and size mode fixed then if the column header text is more than the width then the header text is not displaying.

Please go through the attachment for understanding of desired output.

 

Thank you.

0
Ivaylo Gergov
Telerik team
answered on 01 Aug 2016, 05:34 AM
Hello,

You can change the column header content like this:

<telerik:DataGridTextColumn.Header>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
 
        <TextBlock Text="first line" />
        <TextBlock Text="second line" Grid.Row="1" />
    </Grid>
</telerik:DataGridTextColumn.Header>

The binding context would be the default header content which is the property name of the column.

Regards,
Ivaylo Gergov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataGrid
Asked by
Suresh
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Suresh
Top achievements
Rank 1
Share this question
or