PanelBarItem Style in a HierarchicalDataTemplate

3 posts, 0 answers
  1. Betty Häusler
    Betty Häusler avatar
    3 posts
    Member since:
    Mar 2010

    Posted 08 Jul 2010 Link to this post


    I´ve got a problem with styling an PanelBarItem in a HierarchicalDataTemplate.
    I copied a style and tried to bind it to my PanelBarItem, but only the default-style appears (with the exception of the foreground, this color agrees with my style ).

    Do I have a simple PanelBar with a view items in it and bind the style to it, everything is fine.
    Causes the HierarchicalDataTemplate this missing style?

    Below the Structure of my PanelBar: 


    <DataTemplate x:Key="BereicheTemplate"> 
    <StackPanel Orientation="Vertical" Margin="5">
    <TextBlock Margin="5" Text="{Binding Name}"/>
    <HierarchicalDataTemplate  x:Key="ItemPanelTemplateThemen"
                               ItemTemplate="{StaticResource BereicheTemplate}"
                               ItemsSource="{Binding BereicheListe}" >
    <telerik:RadPanelBarItem   Style="{DynamicResource RadPanelBarItemStyleMC}"  
                               HeaderTemplate="{DynamicResource ThemenDataTemplate}"
                               Header="{Binding}" >

    <telerik:RadPanelBar x:Name="ThemenListe" Margin="0,23.424,0,147.867" ItemTemplate="{DynamicResource ItemPanelTemplateThemen}" Style="{DynamicResource RadPanelBarStyleMC}" >










  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 13 Jul 2010 Link to this post

    Hi Betty Häusler,

    The DataTemplate is concerned with only the presentation and appearance of the data objects. In most cases, all other aspects of presentation, such as what an item looks like or how the PanelBar lays out its items, do not belong in the definition of a DataTemplate. In such cases is used the ItemContainerStyle property, which gives you the ability to control the layout of the PanelBarItems.

    I prepared a sample project illustrating this approach. Please take a look at it and let me know if it works for you.

    All the best,
    Tina Stancheva
    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
  3. Betty Häusler
    Betty Häusler avatar
    3 posts
    Member since:
    Mar 2010

    Posted 13 Jul 2010 Link to this post

    Thank you very  much. I already solved the problem.
    I didn´t realized the containerstyle because there is no containertemplate at the additional templates in blend. 
    It would be nice to see the available templates.

    Thanks anyway!
Back to Top