RadPanelBarItem - line break in Header

2 posts, 0 answers
  1. Chris
    Chris avatar
    26 posts
    Member since:
    Jun 2010

    Posted 10 Nov 2010 Link to this post

    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?



  2. Alex Fidanov
    Alex Fidanov avatar
    637 posts

    Posted 15 Nov 2010 Link to this post

    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:

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

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