How to display DataGrid Column header in 2 lines?

6 posts, 0 answers
  1. Suresh
    Suresh avatar
    3 posts
    Member since:
    Mar 2015

    Posted 14 Jul Link to this post

    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.

  2. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 20 Jul Link to this post

    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
  3. Suresh
    Suresh avatar
    3 posts
    Member since:
    Mar 2015

    Posted 25 Jul in reply to Ivaylo Gergov Link to this post

    Hi,

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

    Thank you.

  4. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 28 Jul Link to this post

    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
  5. Suresh
    Suresh avatar
    3 posts
    Member since:
    Mar 2015

    Posted 28 Jul in reply to Ivaylo Gergov Link to this post

    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.

  6. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 01 Aug Link to this post

    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
Back to Top