Custom Style for TreeView Nodes

2 posts, 0 answers
  1. Michael Cranford
    Michael Cranford avatar
    10 posts
    Member since:
    Nov 2004

    Posted 20 Dec 2009 Link to this post

    I have clickable nodes in my treeview. I am adding a custom class to them, but I cannot get this to show up. I have tried a wide variety of settings in CSS. The class I am adding is called rednode. Here is what the node looks like in the page source:

    <li class="rtLI"><div class="rtMid">


    <
    span class="rtSp"></span><input type="checkbox" class="rtChk" /><img src="images/page_white_text.png" alt="" class="rtImg" /><a class="rtIn rednode" href="javascript:setValue('10003')">Great Deals</a>


    </
    div></li>



    Could you please tell me what to do in my style sheet so that this node is colored red?? The sample on your site does not use a linked node.

    Michael
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Dec 2009 Link to this post

    Hi Michael,

    I guess you are setting the CssClass for each node and the style is not applying properly. If so try adding !important modifier and see whether it is working fine.

    CSS:
     
        <style type="text/css"
        .redNode 
        { 
            color: Red !important; 
        } 
        </style> 

    ASPX:
     
    <telerik:RadTreeNode runat="server"  NavigateUrl="Redirect.aspx" CssClass="redNode"  Text="CPU"
     . . . 

    -Shinu.
Back to Top