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

ExpanderStyle doesn't apply to RadPanelBar

2 Answers 79 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Manuel
Top achievements
Rank 1
Manuel asked on 25 Oct 2011, 02:09 PM
Hello,
I hope I haven't overlooked a thread or support-page. I'm using the RadPanelBar with the help of a Binding (see code below) to a dictionary.
All works fine, I see my items and my childs. But now I'm trying to remove the arrow (expander) from the Header-elements. I already tried the ExpanderStyle-Property and set it Opacity to 0 (like I saw in an example related to a TreeView) but nothing changes and it seems, that the ExpanderStyle-Property isn't applied in any way.

What is my mistake?

<telerik:RadPanelBar Height="100" Width="300" x:Name="RadPanelMenu" ExpandMode="Single" ItemsSource="{Binding MenuItems}">
    <telerik:RadPanelBar.ExpanderStyle>
        <Style TargetType="ToggleButton">
            <Setter Property="Opacity" Value="0"/>
        </Style>
    </telerik:RadPanelBar.ExpanderStyle>
    <telerik:RadPanelBar.ItemTemplate>
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Path=Value}">
            <telerik:HierarchicalDataTemplate.ItemTemplate>
                <DataTemplate>
                    <HyperlinkButton NavigateUri="{Binding Path=Target}" Command="{Binding Path=Command}" Content="{Binding Path=Image}" Tag="{Binding Path=Title}" Style="{StaticResource ParentMenuItemStyle}"/>
                </DataTemplate>
            </telerik:HierarchicalDataTemplate.ItemTemplate>
            <HyperlinkButton NavigateUri="{Binding Path=Key.Target}" Command="{Binding Path=Key.Command}" Content="{Binding Path=Key.Image}" Tag="{Binding Path=Key.Title}" Style="{StaticResource ParentMenuItemStyle}"/>
        </telerik:HierarchicalDataTemplate>
    </telerik:RadPanelBar.ItemTemplate>
</telerik:RadPanelBar>

Additionally I want to change later on the background and much more of the styling, so I guess it would be a good solution to edit the template and directly removes the arrows? I already tried something with that but than my DataTemplate (see above) wasn't used anymore...

So how could the expander easily removed and the Header- and Children-backgrouns easily changed?
 
Thank you very much in advance!

2 Answers, 1 is accepted

Sort by
0
Manuel
Top achievements
Rank 1
answered on 26 Oct 2011, 06:50 AM
Okay I solved this issue now with redefining the Template and ChildItemsTemplate (see code below) of RadPanelBarItem. So I could easily remove the arrow and also define the background etc.
I didn't know, that you can assign a DataTemplate to a ContentPresenter, which was important for displaying the data correctly.

The default templates can be seen here: http://www.telerik.com/help/silverlight/radpanelbar-required-template-parts.html
So based on them you can easily adjust the styling.

<Style TargetType="telerik:RadPanelBarItem">
    <Setter Property="Template" Value="{StaticResource PanelBarItemTopLevelTemplate}" />
    <Setter Property="ChildItemsTemplate" Value="{StaticResource PanelBarItemSecondLevelTemplate}" />
</Style>

Just for people with similiar problems ;).
0
Petar Mladenov
Telerik team
answered on 28 Oct 2011, 12:25 PM
Hi Manuel,

 We're glad to hear that you have solved this. We just wanted to mention that the ExpanderStyle cannot be used in RadPanelBar. This property is inherited from RadTreeView but it is never used in PanelBar. Please excuse us for any inconvenience caused.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
PanelBar
Asked by
Manuel
Top achievements
Rank 1
Answers by
Manuel
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or