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

Assign ID to Individual Tabs?

1 Answer 159 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 06 Jul 2010, 04:39 PM
I'd like to assign a unique id to each tab within the tabstrip but it appears this is a read only attribute.  I'm using my own css and I'd like to assign a dynamic css class to each tab depending on a number of variables.

Utilizing the FindTabByValue doesn't won't work for what I'm trying to do since I need to assign a new css background based on the id of the entire tab, not just the anchor or span tag within that tab. 

Has anyone been able to do this?

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 12 Jul 2010, 12:57 PM
Hi Kelly,

I am not quite sure what your goal is, but if you need to set a css class on the 'li' element of the tab, you can use jQuery. For example, try the following code, view what is rendered on the client and let me know if this is what you need:
<script type="text/javascript">
       function pageLoad() {
           var tabstrip = $find('<%=RadTabStrip1.ClientID %>');
           $telerik.$(tabstrip.findTabByValue('this').get_element()).addClass("CustomClassForLI");
       }
   </script>
   <telerik:RadTabStrip ID="RadTabStrip1" runat="server">
       <Tabs>
           <telerik:RadTab runat="server" Text="Root RadTab1">
           </telerik:RadTab>
           <telerik:RadTab runat="server" CssClass="CustomClassForLink" Value="this" Text="Root RadTab2">
           </telerik:RadTab>
           <telerik:RadTab runat="server" Text="Root RadTab3">
           </telerik:RadTab>
       </Tabs>
   </telerik:RadTabStrip>


Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
Kelly
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or