Hovered and Selected CssClass not applying

5 posts, 0 answers
  1. Deepthi
    Deepthi avatar
    1 posts
    Member since:
    Jul 2008

    Posted 21 Jul 2008 Link to this post

    Can I know when was the latest version of RadTreeView posted?CssClass is being applied but where as SelectedCssClass and HoveredCssClass is not being applied even though .rtln is given beside the class specified in the stylesheet.

    Can anyone help?
  2. EBS
    EBS avatar
    44 posts
    Member since:
    Jul 2012

    Posted 29 Jan 2009 Link to this post

    I am having the same issue with the hovered style not applying.  I am programatically creating the tree nodes and adding the .HoverCssClass in the code behind.  I also added the .rtIn to the style.  please advise.

    <style>  
        .myNodeCss  
        {    
            color : red;    
        }    
            
        .myNodeHoveredCss .rtln    
        {    
            color : blue !important;    
        }    
            
        .myNodeSelectedCss .rtln    
        {    
            colorgreen !important;    
        }    
            </style> 

    Dim AcctGroupNode As New RadTreeNode()  
                    AcctGroupNode.Checked = True 
                    AcctGroupNode.Value = GroupRow("ag_type").ToString()  
                    AcctGroupNode.Expanded = True 
                    AcctGroupNode.Attributes.Add("level""group")  
     
                    AcctGroupNode.CssClass = "myNodeCss" 
                    AcctGroupNode.HoveredCssClass = "myNodeHoveredCss" 
                    AcctGroupNode.SelectedCssClass = "myNodeSelectedCss" 
     
                    TopNodeLevel.Add(AcctGroupNode) 
  3. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 30 Jan 2009 Link to this post

    Hi,

    Try the CSS selector .rtIn instead of .rtln in the styles and see whether its working fine. Checkout the links to the online documentation which explains about Skin CSS File and CSS Skin File Selectors.

    CSS:
    <style type="text/css">  
    .myNodeCss    
    {      
        color : red;      
    }   
    .myNodeHoveredCss .rtIn      
    {      
        color : blue !important;      
    }      
    .myNodeSelectedCss .rtIn      
    {      
        colorgreen !important;      
    }  
    </style>  

    Thanks,
    Princy.
  4. Peichung
    Peichung avatar
    37 posts
    Member since:
    Aug 2008

    Posted 15 Jul 2009 Link to this post

    Hi,

    The suggested solution does work.  However, I databind my tree, so I have to loop through all the nodes right after data binding:

            foreach (RadTreeNode td in myTree.Nodes)  
            {  
                td.SelectedCssClass = "treenode-selected";  
                td.HoveredCssClass = "treenode-hovered";  
                  
            } 

    Is there more efficient way to do this if I want to apply the same style to all the nodes?  Thanks,

    Peichung
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 16 Jul 2009 Link to this post

    Hi Peichung,

    You can set the DataBindings of the RadTreeView:

    <DataBindings> 
          <telerik:RadTreeNodeBinding SelectedCssClass="treenode-selected" HoveredCssClass="treenode-hovered" /> 
    </DataBindings> 

    I hope this helps.

    Greetings,
    Veselin Vasilev
    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.
Back to Top