Image for RadTabItem header

7 posts, 0 answers
  1. Srinivasa
    Srinivasa avatar
    2 posts
    Member since:
    Feb 2009

    Posted 03 Mar 2009 Link to this post

    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
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 07 Mar 2009 Link to this post

    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.
  3. DevCraft banner
  4. Srinivasa
    Srinivasa avatar
    2 posts
    Member since:
    Feb 2009

    Posted 07 Mar 2009 Link to this post

    Thank you.
  5. Kevin Marois
    Kevin Marois avatar
    16 posts
    Member since:
    May 2010

    Posted 30 Jan 2012 Link to this post

    I am setting up the tab items in the code behind. How can I create tabs with images in the code behind?

    Thank you
  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 02 Feb 2012 Link to this post

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

  7. Shawn
    Shawn avatar
    5 posts
    Member since:
    Jun 2011

    Posted 16 Jan 2014 Link to this post

    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

  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 20 Jan 2014 Link to this post

    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 >>
Back to Top
DevCraft banner