This is a migrated thread and some comments may be shown as answers.
Disabling Styles Hover and Selected
6 Answers 192 Views
This is a migrated thread and some comments may be shown as answers.
Henrique Duarte
Top achievements
Rank 1
Veteran
Henrique Duarte asked on 05 Jun 2008, 10:06 PM
How can I disable the hover and selected style from a TreeView?
I found this thread ( http://www.telerik.com/community/forums/thread/b311D-bdakad.aspx ) talking about a HoveredCssClass ans SelectedCssClass property, but I didn't find these properties.

[]'s,

Henrique

6 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 06 Jun 2008, 01:49 PM
Hello Henrique Duarte,

You can do so by modifying the current skin. For example for the default skin you can use the following CSS:
        <style type="text/css">
        .RadTreeView_Default .rtHover span.rtIn
        {
            color: black !important;
            background:none !important;
            border: none !important;
            padding: 2px !important;
        }

        .RadTreeView_Default .rtSelected span.rtIn
        {
            color: black !important;
            background:none !important;
            border: none !important;
            padding: 2px !important;
        }
    </style>

Kind regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jorge
Top achievements
Rank 1
answered on 10 Jul 2009, 06:14 PM
I tried your suggested solution and it did not work. I too need to disable the highlight effects in one of my RadTreeViews.

Another thing I need is to set the default expand level for the tree, and yet another is to disable selection entirely, since I am using embeded controls to handle clicks. How can this be done?

Could you please consider adding simple parameters that handle these scenarios, instead of making us create coding hacks? Something like:

DisableHoverEffect = True
DisableSelectEffect = True
DisableSelect = True
DefaultExpandLevel = (Integer)
0
Fabio Rocha de Pinho
Top achievements
Rank 1
answered on 29 Jul 2009, 03:20 PM
Hi Jorge, I had the same problem and fixed using a code similar to what Albert sugested:

.RadTreeView_themename .rtHover .rtIn
{  
    background:none !important;
    border: none !important;
    padding: 2px !important;
}

.RadTreeView_themename .rtSelected .rtIn
{  
    background:none !important;
    border: none !important;
    padding: 2px !important;
}

Regards,

Fabio
0
Wyatt
Top achievements
Rank 1
answered on 06 May 2010, 06:51 PM
Thanks for this great information, guys!  I modified your solutions slightly to work for the several built-in skins I tested.  This style is only appled if the tree's CssStyle = "ReadOnly".  This allows the style to be defined globally without affecting all trees.

    div.RadTreeView.ReadOnly .rtHover .rtIn,  
    div.RadTreeView.ReadOnly .rtSelected .rtIn  
    {  
        color:inherit !important;  
        background:none !important;  
        bordernone !important;  
        padding4px 3px 3px 3px !important;  
    } 
0
Nicolaï
Top achievements
Rank 2
answered on 09 Nov 2011, 12:25 PM
Thanks Wyatt.
Would be an idea to add some styling properties, as suggested above. Next time I need this, I will probably have to do another search on the website, or a search in my code, if I can remember where I used it..
0
Kate
Telerik team
answered on 09 Nov 2011, 02:00 PM
Hello Nicolaï,

You can refer to the following help article for more details on the different css classes that are applied to the RadTreeView control.  

Greetings,
Kate
the Telerik team
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 their blog feed now
Asked by
Henrique Duarte
Top achievements
Rank 1
Veteran
Answers by
Atanas Korchev
Telerik team
Jorge
Top achievements
Rank 1
Fabio Rocha de Pinho
Top achievements
Rank 1
Wyatt
Top achievements
Rank 1
Nicolaï
Top achievements
Rank 2
Kate
Telerik team
Share this question
or