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

Change tab color

8 Answers 639 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
CarlosCisneros
Top achievements
Rank 1
CarlosCisneros asked on 11 Sep 2008, 01:43 PM
Hi.

I'm using a tab strip with Office 2007 skin and i need to change the color of one tab when there's been an error on one field inside the tab. how could i do this.

thanks in advanced.

8 Answers, 1 is accepted

Sort by
0
-DJ-
Top achievements
Rank 1
answered on 15 Sep 2008, 12:03 PM
Hi Carlos,

You can probably just set a specific css class for the tab where you override the default tab look.

Regards,
-DJ-
0
Accepted
Paul
Telerik team
answered on 16 Sep 2008, 09:03 AM
Hello Carlos,

The RadTab class expose the following properties that can be used to apply certain CSS classes to the tabs:

  • CssClass - it is always applied regardless the tab state.
  • DisabledCssClass - it is applied when the tab is disabled (Enabled = false).
  • SelectedCssClass - it is applied when the tab is selected.
  • HoveredCssClass - it is applied when the tab is hovered with the mouse.
Each of the above properties determines the CSS class to be applied to the tab when it is in the respective mode (normal, disabled, selected and hovered). For details on the matter please refer to our Custom CSS Classes and Unique Tab Appearance examples.

Best wishes,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Christopher Blickley
Top achievements
Rank 2
answered on 02 Oct 2008, 04:06 PM
Paul,

Is there anyway to get the CSS class applied to an individual tab to work along with the Skin?  Applying a CSS class to the tab works, but only when the Skin on the entire tabstrib is set to "".

What I would like to do is use a skin, but then change one element, like the text color when I need to draw the users attention to a particular tab.

When the skin is set, the CSSClass property of the tab has no effect, neither does setting the ForeColor property of the tab.

Thanks,
Chris
0
Paul
Telerik team
answered on 06 Oct 2008, 01:33 PM
Hello Christopher,

In order to achieve your goal you will have to use the !important clause.

<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
    <style type="text/css">  
    .myCustomClass  
    {    
        color: red !important;  
    }  
 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <telerik:RadTabStrip ID="tbMain" runat="server">  
            <Tabs> 
                <telerik:RadTab runat="server" Text="Root RadTab1">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab2" CssClass="myCustomClass">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab3">  
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
    </form> 
</body> 
</html> 


Sincerely yours,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ranganath
Top achievements
Rank 1
answered on 17 Oct 2008, 02:05 PM
Hi,
Even i tried with u r solution,even though no use.
can u guide me another ways to Fix tabColors?

Ranganath
0
Paul
Telerik team
answered on 17 Oct 2008, 02:16 PM
Hello Ranganath,

It will be best if you can open a support ticket and send us a simple running project (incl. your custom skin, CSS, images, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Thanks beforehand for your patience and cooperation,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Darius
Top achievements
Rank 1
answered on 07 Oct 2020, 12:48 PM

so twelve years later, after original posts, I have same problem and wanted to add to the solution. If using a skin with the tabstrip, then setting the individual tab color only works if you get rid of the background image.

This worked:

.RadTabStrip .myCustomClass .rtsLink    
  {
        background-image:none;
     background-color:red !important;
   color:white !important;
}

 

0
Vessy
Telerik team
answered on 07 Oct 2020, 07:15 PM

Hi,

Thanks a lot for sharing your solution with the community, Darius! The other option is to set the EnableEmbeddedSkins="false" property, so the image sprites will not be loaded like demonstrated here:

https://demos.telerik.com/aspnet-ajax/tabstrip/examples/appearance/uniquetabappearance/defaultcs.aspx

Regards,
Vessy
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
TabStrip
Asked by
CarlosCisneros
Top achievements
Rank 1
Answers by
-DJ-
Top achievements
Rank 1
Paul
Telerik team
Christopher Blickley
Top achievements
Rank 2
Ranganath
Top achievements
Rank 1
Darius
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or