Controls before/after tab items

3 posts, 0 answers
  1. Mark
    Mark avatar
    35 posts
    Member since:
    Nov 2008

    Posted 27 Sep 2012 Link to this post

    Hello,

    I have the need to display controls before and/or after the tab items themselves.

    Please see the attached screenshot to demonstrate the behavior I'm after.

    How can I accomplish this using the Telerik WPF TabControl?

    Thanks for any assistance.
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 02 Oct 2012 Link to this post

    Hi Mark,

    As far as I understand you need to display some additional information inside the TabStrip area of the RadTabControl. This could be achieved by customizing the corresponding Template used by the control. Additional information about Editing Control Templates you can find in this article.

    I created and attached in the sample project a file called "TabControlStyleResources.xaml" which describes all styles and templates used by the RadTabControl. In order to use these styles you have to explicitly define the file as a MergedDictionary Resource. This could be done this way:

    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="TabControlStyleResources.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

    I`ve added a TextBlock and a Button in the default RadTabControl Template with this code:

    <telerik:RadDockPanel Margin="2,4,2,2" Width="Auto" telerik:RadDockPanel.Dock="Right">
        <TextBlock Width="Auto" Padding="10,0,0,0" VerticalAlignment="Center" Text="Example@examples.com"/>
        <telerik:RadButton Content="Test Button" Margin="10,0,10,0" VerticalAlignment="Center" />
    </telerik:RadDockPanel>

    If you need to customize further the TabStip area (changing the controls I`ve added or their position) you have to edit the file.

    If you have any questions don`t hesitate to ask.

    Greetings,
    TeamX2_Pavel
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Mark
    Mark avatar
    35 posts
    Member since:
    Nov 2008

    Posted 03 Oct 2012 Link to this post

    Thank you for this sample, it seems to work nicely.

    Though I'm somewhat astounded by the amount of markup required to achieve such a simple goal.
Back to Top