Telerik
Skip Navigation LinksHome / Community / Forums / ASP.NET > Tabstrip > Dynamicly change tab apperance on an event

Not answered Dynamicly change tab apperance on an event

Feed from this thread
  • Jeff avatar

    Posted on May 14, 2009 (permalink)

    Folks,

    I have a Web app that has 12 static tabs with each of the tabs having it's own set of objects ranging from graphics to database grids.  I have a couple of the tabs that will periodically check for updates in the database and I would like to be able to change the font of the tab along with the color of the font when a record from the db matches certain criteria letting the user know that they need to select the tab to acknowledge the request on a tab.  Once they've ack'ed the request the tab look should revert back to the original look.  So far I have not been successful in coding this.

    Any suggestions?

    Reply

  • Telerik Admin admin's avatar

    Posted on May 16, 2009 (permalink)

    Hello Jeff,

    Here's a sample code snipper that shows the needed approach.

    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title></title>  
        <style type="text/css">  
            .red .rtsTxt  
            {  
                color: Red !important;  
            }  
        </style> 
    </head> 
    <body> 
        <form runat="server" id="mainForm" method="post">  
        <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
     
        <script type="text/javascript">  
            function changeColor(tabname) {  
                var tabstrip = $find('<%= RadTabStrip1.ClientID %>');  
                var tab = tabstrip.findTabByText(tabname);  
                tab.set_cssClass("red");  
            }  
     
            function setColorBack(sender, eventArgs) {  
                var tab = eventArgs.get_tab();  
                if (tab.get_cssClass() == "red") {  
                    tab.set_cssClass("");  
                }  
            }  
        </script> 
     
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" OnClientTabSelected="setColorBack">  
            <Tabs> 
                <telerik:RadTab runat="server" Text="Root RadTab1">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab2">  
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab3">  
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <input id="Button1" type="button" value="button" onclick="changeColor('Root RadTab2')" /> 
        </form> 
    </body> 
    </html> 


    Greetings,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

Back to Top

Skip Navigation LinksHome / Community / Forums / ASP.NET > Tabstrip > Dynamicly change tab apperance on an event

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use | Privacy Policy
Copyright © 2002-2010 Telerik. All rights reserved.