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

[Solved] Can we disable the mouse hovering and high-light?

3 Answers 112 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nim
Top achievements
Rank 1
Nim asked on 24 Feb 2011, 10:39 PM
Hello,

I am using the treeview to display some data like the following:

  <% string a = ...
        string b = ...
        string c = ... %>
   <%= Html.Telerik().TreeView().Name("treeview").ExpandAll(true)
            .Items(item => {
                item.Add().Text(a).Items(
                        subItem =>  {
                            subItem.Add().Text(b);
                            subItem.Add().Text(c);
                        });})
    %>

It works very well.  Yet I notice if my mouse hovers or if I click on the item, the tree-item will be high-lighted as if it is selected.
I wonder if we can disable the hovering and high-light (when user clicks on the item)?

Many thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 25 Feb 2011, 09:25 AM
Hello Nim,

Yes, you can remove the hovered and selected states' styling with the following CSS rule:

.t-treeview .t-item .t-state-hover,
.t-treeview .t-item .t-state-selected
{
    border-color: transparent;
    background-color: transparent;
}

Depending on the skin, you may also need to redefine the text color in the same fashion as shown.

Greetings,
Dimo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Nim
Top achievements
Rank 1
answered on 25 Feb 2011, 10:00 PM
Thank you for your reply!!  This solves my issue.

FYI, when I put:
 
border-color: transparent;

to a css file through VS 2008, an error message shows up:

Validation (CSS2.1):'transparent' is not a valid value for the 'border-color' property.

Currently I'm using "White" instead of "transparent" to avoid the error message.

0
Dimo
Telerik team
answered on 28 Feb 2011, 08:22 AM
Hi Nim,

Visual Studio is not the best source for learning CSS :)

http://www.w3.org/TR/CSS21/box.html#propdef-border-color

Greetings,
Dimo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TreeView
Asked by
Nim
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Nim
Top achievements
Rank 1
Share this question
or