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

Controls before/after tab items

2 Answers 68 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 27 Sep 2012, 05:30 PM
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 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 02 Oct 2012, 02:23 PM
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.

0
Mark
Top achievements
Rank 1
answered on 03 Oct 2012, 07:35 PM
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.
Tags
TabControl
Asked by
Mark
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Mark
Top achievements
Rank 1
Share this question
or