Putting other controls into a TabStripPanel

4 posts, 0 answers
  1. simeon
    simeon avatar
    12 posts
    Member since:
    Sep 2008

    Posted 12 Aug 2009 Link to this post

    Hi,

    First post.  Cool control library by the way...

    Is it possible to display other controls in the TabStripPanel in the TabControl.  We would like to display some static data there that really needs to be seen across all the tabs.  I know we could just display the data in textblocks above the tabcontrol but we want the controls to theme the same as the TabStripPanel and kind of look part of it.

    Any recommendations how to do this?

    Cheers,

    Simeon
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 14 Aug 2009 Link to this post

    Hello simeon,

    Please find attached a sample project that shows how to edit the HeaderTemplate and place some content into it.

     <DataTemplate x:Key="header1">
                <StackPanel Orientation="Horizontal">
                    <Ellipse Width="10" Height="10" Fill="Green"
                            VerticalAlignment="Center" Margin="2" />
                    <TextBlock Text="{Binding Name}" />

                </StackPanel>
            </DataTemplate>
    ......
      <nav:RadTabControl x:Name="tabControl" ItemTemplateSelector="{StaticResource myContentTemplates}">
                <nav:RadTabControl.ItemContainerStyle>
                    <Style TargetType="nav:RadTabItem">
                        <Setter Property="HeaderTemplateSelector"
                                Value="{StaticResource myHeaderTemplates}" />
                    </Style>
                </nav:RadTabControl.ItemContainerStyle>
            </nav:RadTabControl>

    I hope that this will help you. Please let us know if you have any other questions.

    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. simeon
    simeon avatar
    12 posts
    Member since:
    Sep 2008

    Posted 14 Aug 2009 Link to this post

    Sorry I dont think I explained quite what I meant.  I thought the TabStrip panel containted the tabsheet headers.  Your example puts content into the tabsheet header.  What I was looking to do was increase the height of the Grey strip that holds all of the tab sheet headers and put a few textbox's with textblocks in it above the tabsheet headers. Then when the UI theme changes to say the office blue one the grey bar goes a light blue colour and the background for our user controls in that region matches it.  Really I was just being lazy in not wanting to find out the colour from the theme and coloring a canva's to match it.


    Cheers,

    Simeon
  5. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 14 Aug 2009 Link to this post

    Hello simeon,

    If you want to accomplish this you have to set some custom template to RadTabControl. For more information please visit the following articles that will help you editing the RadTabControl in Blend:

    http://www.telerik.com/help/silverlight/radcontrols-for-silverlight-expression-blend-support.html
    http://www.telerik.com/help/silverlight/extend-and-modify-builtin-themes.html

    In the RadTabControl  ControlTemplate you have to find "ItemsPresenterElement" and put the TextBloxk next to it the final code should looks like for example:
                <StackPanel>
                    <TextBlock x:Name="text" Text="some text" />
                    <!--TabStrip-->
                    <ItemsPresenter Margin="2 3 0 0"
                                     x:Name="ItemsPresenterElement" />
                  </StackPanel>

    I hope that this will help you.

    Regards,
    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.
Back to Top