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

Secondary Seleted Node Style

2 Answers 45 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 31 Aug 2011, 09:02 PM
Anyone know of an easy way where I can have a secondary Selected node style?  For example node levels 1 - 4 would have Style1 and Nodes 5 & 6 would have Sytle2?

I used the Visual Style Build to create my basic theme, the only problem is that I need to have a secondary "Selected" style depending on the node's level.

On the server side I am simply responding to the Node_Expand event, looping though my data and adding new nodes to the node that was passed in.

2 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 1
answered on 01 Sep 2011, 07:07 PM
Just trying to bump this to the top.  Anyone have an idea?  Could I intercept the mouseOver/Out events and hijack the CSS ".Selected" class that gets auto-magically applied?
0
Plamen
Telerik team
answered on 03 Sep 2011, 05:18 PM
Hi Joe,

Here is one possible way you can set a different style on hover for nodes, depending on the node depth:

<telerik:RadTreeView ID="RadTreeView3" runat="server"    >
            <DataBindings>
                <telerik:RadTreeNodeBinding Expanded="true" Depth="0" HoveredCssClass="hovered1" />
                 <telerik:RadTreeNodeBinding Expanded="true" Depth="1" HoveredCssClass="hovered2" />
            </DataBindings>
</
telerik:RadTreeView>

  .hovered1 .rtIn
   {
    background-image:none !important;
     background-color:Red !important;
   
  }
.hovered2 .rtIn
   {
    background-image:none !important;
    background-color:Blue !important;
  }

Hope this information helps.

Kind regards,
Plamen Zdravkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
TreeView
Asked by
Joe
Top achievements
Rank 1
Answers by
Joe
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or