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

Image for RadTabItem header

6 Answers 388 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Srinivasa
Top achievements
Rank 1
Srinivasa asked on 04 Mar 2009, 04:25 AM
Hi, I am trying to make a proto type using WPF radcontrols. I need to set image/icon for tab raditem header.
is thare any way?

Thanks,
Srini

6 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 07 Mar 2009, 08:32 AM
Hello Srinivasa,

If you want to have images, icons or other content in the RadTabItem header then you have to set the Header property:

1. In a simple scenario with RadTabItem you can set the header as follows  :

<telerik:RadTabControl>
        <telerik:RadTabItem >
            <telerik:RadTabItem.Header>
                <StackPanel Orientation="Horizontal">
                    <Image Source="/Examples/Common/Images/TabControl/Report/Financial.png"
                            Height="16" Width="16" />
                    <TextBlock Text="Financial Report" Margin="3,0,0,0" />
                </StackPanel>
            </telerik:RadTabItem.Header>
        </telerik:RadTabItem>
</telerik:RadTabControl>

2.If you use more complex scenario with DataBinding:
http://demos.telerik.com/silverlight/default.aspx#TabControl/HeaderContent

I hope this answers your question.

Best wishes,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Srinivasa
Top achievements
Rank 1
answered on 07 Mar 2009, 07:30 PM
Thank you.
0
Kevin Marois
Top achievements
Rank 1
answered on 30 Jan 2012, 10:07 PM
I am setting up the tab items in the code behind. How can I create tabs with images in the code behind?

Thank you
0
Petar Mladenov
Telerik team
answered on 02 Feb 2012, 10:57 AM
Hello Kevin Marois,

 This could be something like so:

RadTabControl tabControl = new RadTabControl();
RadTabItem item = new RadTabItem();
Image img = new BitmapImage(...
TextBlock textBlock = new TextBlock(){Text = "Tab Header Text"};
StackPanel stack = new StackPanel(){Orientation = Orientation.Horizontal};
stack.Children.Add(textBlock);
stack.Children.Add(img);
item.Header = stack;
tabControl.Items.Add(item);
However, we highly suggest you to use XAML when its up to configuring your UI. 

All the best,
Petar Mladenov
the Telerik team

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

0
Shawn
Top achievements
Rank 1
answered on 16 Jan 2014, 11:19 PM

Hello,

This link:

http://demos.telerik.com/silverlight/default.aspx#TabControl/HeaderContent



No longer works.  I am using databinding in my tab controls.  I would like to insert some images(along with the DisplayMemberPath text) in my tab headers if possible that I can make visible or hidden depending on whether rules have been broken.  Is it possible to get this link working again so I can have a sample of how to imbed images in tab header items? 



Thank you,

Shawn

0
Petar Mladenov
Telerik team
answered on 20 Jan 2014, 10:42 AM
Hi Shawn,

We have previously removed this demo from our online samples. However, you can use this help article as a reference. It shows how to use the ItemTemplate in which you can have Images and Text bound to properties from your ViewMode. We hope it will help you move on with your requirement.

Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TabControl
Asked by
Srinivasa
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Srinivasa
Top achievements
Rank 1
Kevin Marois
Top achievements
Rank 1
Petar Mladenov
Telerik team
Shawn
Top achievements
Rank 1
Share this question
or