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

Inserting Image in the RadPanelBarItem

2 Answers 99 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
prabhu.m
Top achievements
Rank 1
prabhu.m asked on 28 May 2011, 06:25 AM
Hi please,
Let me know how to insert image in RadPanelBarItem

Thanks
M.Prabhu

2 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 28 May 2011, 08:50 AM
Hi prabhu.m,

It depends on your scenario. There are 3 ways do define an image within a RadPanelBarItem.

  • Using XAML
<telerik:RadPanelBar>
    <telerik:RadPanelBarItem>
        <telerik:RadPanelBarItem.Header>
            <StackPanel Orientation="Horizontal">
                <Image Source="Images/mySamplePic.png" />
                <TextBlock Text="Sample Text" VerticalAlignment="Center" Margin="5 0" />
            </StackPanel>
        </telerik:RadPanelBarItem.Header>
    </telerik:RadPanelBarItem>
</telerik:RadPanelBar>

  • Code behind
RadPanelBar panelBar = new RadPanelBar();
RadPanelBarItem panelBarItem = new RadPanelBarItem();
StackPanel stackPanel = new StackPanel();
stackPanel.Orientation = Orientation.Horizontal;
Image image = new Image();
image.Source = new BitmapImage(new System.Uri("/Images/mySamplePic.png", System.UriKind.RelativeOrAbsolute));
TextBlock textBlock = new TextBlock();
textBlock.Text = "Sample Text";
textBlock.Margin = new System.Windows.Thickness(5,0,0,0);
textBlock.VerticalAlignment = System.Windows.VerticalAlignment.Center;
stackPanel.Children.Add(image);
stackPanel.Children.Add(textBlock);
panelBarItem.Header = stackPanel;
panelBar.Items.Add(panelBarItem);


Kind regards,
Kiril Stanoev
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
prabhu.m
Top achievements
Rank 1
answered on 29 May 2011, 07:45 AM
Thanx, great
Tags
PanelBar
Asked by
prabhu.m
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
prabhu.m
Top achievements
Rank 1
Share this question
or