Changing header color

3 posts, 1 answers
  1. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 30 Mar 2015 Link to this post

    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. Answer
    Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 31 Mar 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 31 Mar 2015 in reply to Evgenia Link to this post

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