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

[Solved] Tree View Apperance

5 Answers 141 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Levi
Top achievements
Rank 1
Levi asked on 04 Apr 2008, 02:49 PM
I am trying to get a node in a tree view to have a back color that spans all the way across the page. But when i applie the background color it only goes as far as the text. Is there a way to do this? I have also tried to change the size of the node but that seems to make no difference.

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 07 Apr 2008, 08:04 AM
Hi Levi,

I suggest that you do the following:

In the <style> tag of your page, add the following CSS declarations:

.rtHover { background: red !important; }
.rtSelected { background: blue !important; }

Hope this helps.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Levi
Top achievements
Rank 1
answered on 07 Apr 2008, 02:38 PM
That works just how i need it too but how do i get it to always be on specific nodes instead of every node when you hover?
0
Nikolay
Telerik team
answered on 08 Apr 2008, 09:18 AM
Hello Levi,

You can use the HoveredCssClass and SelectedCssClass properties of the TreeNodes to apply custom CSS classes only to certain nodes. I attached another sample project to this thread. Please download the files and give them a go.

Hope this helps.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Levi
Top achievements
Rank 1
answered on 08 Apr 2008, 03:14 PM
I looked at your attached solution and that works only for hovering or selecting but i need it on specific nodes always. If i use the normal CssClass attribute then it only affects the text instead of the entire node like the hovered and selected css classes do. Any other ideas?
0
Nikolay
Telerik team
answered on 09 Apr 2008, 09:20 AM
Hi Levi,

Unfortunately, this approach will not work for the CssClass property. It will not apply the css style to the proper DIV. You could use some JavaScript to locate the nodes and apply the needed style to them, however, this would not be a good approach.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Levi
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Levi
Top achievements
Rank 1
Share this question
or