Declined
Last Updated: 26 Aug 2016 09:18 by ADMIN
ADMIN
Telerik Admin
Created on: 04 May 2011 11:13
Category: PanelBar
Type: Feature Request
24
PanelBar: Add an Icon property for the RadPanelBarItem
Add an Icon property to allow displaying images in the RadPanelBarItem Header.

Declined:

Adding such property requires also adding a visual element (Image) in the Template of the RadPanelBarItems.
RadTreeView also has Image in its ControlTemplate and we have to admit this was our design mistake in the past. Such element makes the Style larger, makes the virtualization harder to support, slows down the performance.

How To Add Image in RadPanelBar:

In non-databound scenarios just add the Image in the Header:

      <telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem.Header>
                    <StackPanel>
                        <Image Source="MyImage.png" Margin="5"/>
                        <TextBlock Text="{Binding Name}" />
                    </StackPanel>
                </telerik:RadPanelBarItem.Header>
            </telerik:RadPanelBarItem>

In databound scenario set the ItemTemplate of the RadPanelBar:

DataTemplate x:Key="itemTemplate">
                <StackPanel>
                    <Image Source="MyImage.png" Margin="5"/>
                    <TextBlock Text="{Binding Name}" />
                </StackPanel>
            </DataTemplate>

 <telerik:RadPanelBar ItemTemplate="{StaticResource itemTemplate}"/>

See the SDK example demonstrating those approaches: https://github.com/telerik/xaml-sdk/tree/master/PanelBar/AddHeaderIcon

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
2 comments
ADMIN
Martin
Posted on: 26 Aug 2016 09:18
See the SDK example demonstrating those approaches: https://github.com/telerik/xaml-sdk/tree/master/PanelBar/AddHeaderIcon
Imported User
Posted on: 05 Aug 2011 02:05
We also need it!
Best regards
Oliver Abraham, Inveos