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

PanelBarItem Style in a HierarchicalDataTemplate

2 Answers 145 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Betty Häusler
Top achievements
Rank 1
Betty Häusler asked on 08 Jul 2010, 04:09 PM
Hey,

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}"/>
</StackPanel>
</DataTemplate>
<HierarchicalDataTemplate  x:Key="ItemPanelTemplateThemen"
                           ItemTemplate="{StaticResource BereicheTemplate}"
                           ItemsSource="{Binding BereicheListe}" >
 
<telerik:RadPanelBarItem   Style="{DynamicResource RadPanelBarItemStyleMC}"  
                           HeaderTemplate="{DynamicResource ThemenDataTemplate}"
                           Header="{Binding}" >
</telerik:RadPanelBarItem>
</HierarchicalDataTemplate>
.
.

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

 

 

 

 

 

Regards
Betty

 

 

 

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 13 Jul 2010, 02:17 PM
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
0
Betty Häusler
Top achievements
Rank 1
answered on 13 Jul 2010, 02:27 PM
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!
betty
Tags
PanelBar
Asked by
Betty Häusler
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Betty Häusler
Top achievements
Rank 1
Share this question
or