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

RadPanelBarItem - line break in Header

1 Answer 75 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 10 Nov 2010, 11:09 AM
Hey guys,

i have a question about the ContentPlaceHolder Control in the RadPanelBarItem Header.

My whole PanelBar is limited  to a width of 150 and the PanelBarItems share also the same width. But as Header input i sometimes have text that is longer than 150 in width. I´ve expected that the ContentPlaceHolder will automatically generate line breaks to display the content. 

But i was really surprised that the ContentPlaceHolder doesn´t made a line break and the text is keep floating in one line and fading out at the point of 150 in width.

Have you any suggestions how i can achieve a linebreak or am i doing something wrong?

Regards

Chris
 

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 15 Nov 2010, 10:15 AM
Hi Chris,

You can create and apply a header template to the PanelBar's HeaderTemplate property and place a TextBlock with TextWrapping property set to Wrap. Here is a small code snippet for this:

<UserControl.Resources>
    <DataTemplate x:Key="HeaderTemplate">
        <Grid>
            <TextBlock TextWrapping="Wrap" Text="{Binding}"/>
        </Grid>
    </DataTemplate>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
    <telerik:RadPanelBar x:Name="panelBar" MaxWidth="150">
        <telerik:RadPanelBarItem MaxWidth="150" Header="Loooooooooooooooooooooooooooooong Item 1" 
        HeaderTemplate="{StaticResource HeaderTemplate}"/>
    </telerik:RadPanelBar>
</Grid>


Kind regards,
Alex Fidanov
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
PanelBar
Asked by
Chris
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or