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

Changing header color

2 Answers 414 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Amige
Top achievements
Rank 1
Veteran
Amige asked on 30 Mar 2015, 06:37 PM
Hello, I have a RadTabControl with several RadTadItems, I've created a style for each RadTabItem to assign different colors to the headers:

<Style TargetType="telerik:RadTabItem" x:Key="TabItemStyle1">
            <Setter Property="Background" Value="Red"/>
</Style>

Is it possible to assign the same color of the header when the RadTabItem is selected?

Thanks in advance,

Alberto

2 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 31 Mar 2015, 10:36 AM
Hi Amige,

You might use Style Triggers to manage the appearance of tab items when selected like this:

<Style TargetType="telerik:RadTabItem" BasedOn="{StaticResource RadTabItemStyle}">
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="Red" />
                </Trigger>
            </Style.Triggers>
        </Style>

P.S. Since you are new to XAML and our controls I highly recommend that you take a look at Microsoft msdn topics that describe how to change controls appearance and our documentation where you will find the major features and visual structure of RadTabControl.


Evgenia
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Amige
Top achievements
Rank 1
Veteran
answered on 31 Mar 2015, 04:38 PM
Hello Evgenia,

Actually, I have several RadTadItems each one with a different color (I have attached an image showing this), based on your answer I think that I could use a MultiTrigger to check when the Item is selected and another property like the name or the tag to know which color should I apply.

Thanks,

Alberto
Tags
TabControl
Asked by
Amige
Top achievements
Rank 1
Veteran
Answers by
Evgenia
Telerik team
Amige
Top achievements
Rank 1
Veteran
Share this question
or