Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > PanelBar > ExpanderStyle doesn't apply to RadPanelBar

Not answered ExpanderStyle doesn't apply to RadPanelBar

Feed from this thread
  • Manuel avatar

    Posted on Oct 25, 2011 (permalink)

    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!

    Reply

  • Manuel avatar

    Posted on Oct 26, 2011 (permalink)

    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 ;).

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Oct 28, 2011 (permalink)

    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 >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > PanelBar > ExpanderStyle doesn't apply to RadPanelBar
Related resources for "ExpanderStyle doesn't apply to RadPanelBar"

Silverlight PanelBar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]