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

Hovered and Selected CssClass not applying

4 Answers 168 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Deepthi
Top achievements
Rank 1
Deepthi asked on 21 Jul 2008, 12:43 PM
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?

4 Answers, 1 is accepted

Sort by
0
EBS
Top achievements
Rank 1
answered on 29 Jan 2009, 03:52 PM
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) 
0
Princy
Top achievements
Rank 2
answered on 30 Jan 2009, 10:26 AM
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.
0
Peichung
Top achievements
Rank 1
answered on 15 Jul 2009, 05:12 PM
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
0
Veselin Vasilev
Telerik team
answered on 16 Jul 2009, 07:48 AM
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.
Tags
TreeView
Asked by
Deepthi
Top achievements
Rank 1
Answers by
EBS
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Peichung
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or