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

Explicitly Inserting LineBreaks in ColumnHeaders

1 Answer 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bob Mills
Top achievements
Rank 2
Bob Mills asked on 01 Jun 2010, 10:51 PM
How can I explicitly indicate that I want a linebreak to be at a certain point in GridViewDataColumn header attribute? 

 

<telerik:GridViewDataColumn Header="Happy<LineBreakHere>(Days)"/> 

 

 

 

I want the text to be centered with (Days) appearing underneath "Happy", and I want to do this without implementing any Wrapping/ColumnWidth tricks.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 02 Jun 2010, 07:06 AM
Hi,

Since Header property is object you can place anything - even UI elements to achieve desired formatting. For example:

              <telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn.Header>
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                            <TextBlock Text="Happy" />
                            <TextBlock Text="(Days)" />
                        </StackPanel>
                    </telerik:GridViewDataColumn.Header>
                </telerik:GridViewDataColumn>

Best wishes,
Vlad
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Bob Mills
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or