Changing cssClass name of UL

6 posts, 0 answers
  1. thomson
    thomson avatar
    22 posts
    Member since:
    Jun 2009

    Posted 04 Dec 2013 Link to this post

    Hi ,
               I have only the root tab with few items , the tabs are generated from a datasource . the code generated is like this

    <div id="ctl00__RadTabStrip1" class="RadTabStrip RadTabStrip_Suntab RadTabStripTop_Suntab ">
    <div class="rtsLevel rtsLevel1">
    <ul class="rtsUL"><li class="rtsLI rtsFirst"><a title="" class="rtsLink rtsSelected" href=""><span class="rtsOut"><span class="rtsIn"><span class="rtsTxt">Overview</span></span></span></a></li></ul>
    </div>


    I need to change the class name of ul from rtsUL to something else . How is this possible?

    Thanks
    Thomson
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Dec 2013 Link to this post

    Hi thomson,

    Please try the following code snippet to change the class name.

    JavaScript:
    <script src="../JS/jquery-1.10.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function pageLoad() {
            $(".rtsUL").attr('class', 'newClass');
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. thomson
    thomson avatar
    22 posts
    Member since:
    Jun 2009

    Posted 08 Dec 2013 Link to this post

    Hi Shinu,
                    I do want to avoid the delay made by Jquery. I was looking for any attributed like CssClass . I did try few also

    Thanks
    Thomson
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2013 Link to this post

    Hi thomson,

    I guess that you want to change the css of RadTabStrip from 'rtsUL' to one new CSS. Please have a look into the following code snippet.

    ASPX:
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" DataFieldID="id" DataFieldParentID="parentid"
        DataTextField="text" DataSourceID="SqlDataSource1" CssClass="demo">
    </telerik:RadTabStrip>

    CSS:
    <style type="text/css">
     .demo
     {
         border: 1px solid red !important;
         margin-left: 25px !important;
     }
    </style>

    Please elaborate your requirement if it doesn't help.
    Thanks,
    Shinu.
  6. thomson
    thomson avatar
    22 posts
    Member since:
    Jun 2009

    Posted 11 Dec 2013 Link to this post

    i had tried the CssClass attribute on the Tabstrip , it applies on the div tab not on the ul
  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 13 Dec 2013 Link to this post

    Hello Thomson,

    Can you clarify why you need to change the class name of the ul element in the RadTabStrip. Instead you can easily overwrite the needed css class selector by simply increasing its specificity as described here

    Regards,
    Kate
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017