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

[Solved] How to clear style of singe node

4 Answers 181 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Thomas Kristensen
Top achievements
Rank 1
Thomas Kristensen asked on 14 Jan 2008, 02:07 PM
Hi

I have a treeview. When the user clicks a node a custom control is added to the node by using the function:

clickednode.controls.add(MyCustomDatagrid)

The problem is that the node where the control is added to has a style applied, and that I do not want as the control (datagrid) added to the node not must be formatted.

How do I clear the style of the node.

I do not want to set the CSS of the node, I just want to clear it.

Looking forward to solve this issue.

Best Regards
Thomas

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Jan 2008, 02:44 PM
Hello Thomas,

Could you please tell us what skin are you using? Also which styles would you like to remove? By default selection and hover effects may be applied to templated nodes.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas Kristensen
Top achievements
Rank 1
answered on 15 Jan 2008, 06:48 AM
Hi

I am using the "Default2006" skin.

I would like to remove the hover style, it is an underline, I would also like to remove the selected style. My custom control gets blue if I click on it, and that I do not want.

I have tried to set the HoveredCssClass and SelectedCssClass of the node to string.empty, but that does nothing.

I would really avoid setting the styles in a stylesheet, as that would mean maintaining more code for nothing, I simply just not want any style to format my custom control.

Looking forward to your reply

Best Regards
Thomas
0
Atanas Korchev
Telerik team
answered on 15 Jan 2008, 08:36 AM
Hi Thomas Kristensen,

HoveredCssClass and SelectedCssClass are by default string.empty that's why setting them does nothing.

You need to apply custom CSS styles to override the default skin styles. Here is how to disable the hover and selected styles for the Default2006 skin:
    <style type="text/css"
    .MyHover .rtIn 
    { 
        text-decoration:none !important; 
    } 
    .MySelected .rtIn 
    { 
        background-color:transparent !important; 
        color:black !important; 
    } 
    </style> 
 
<telerik:RadTreeNode HoveredCssClass="MyHover" SelectedCssClass="MySelected"


Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas Kristensen
Top achievements
Rank 1
answered on 15 Jan 2008, 10:14 AM
Hi

Tried your solution and it worked.

Thanks a lot.
Tags
TreeView
Asked by
Thomas Kristensen
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Thomas Kristensen
Top achievements
Rank 1
Share this question
or