how to change treeview selected node color in c# or vb.net

Posted by Naidulaxmi under ASP.NET on 2/25/2014 | Points: 10 | Views : 6977 | Status : [Member] | Replies : 1
Hi Friends,


How to implement how to change treeview selected node color in c# or vb.net.Could you please give me one example .This is most urgent.

Thanks,

appalanaidu


Responses

Posted by: Deepthijk on: 3/5/2014 [Member] Starter | Points: 25

Up
0
Down
/* Styles: put this at style section or at your .css file */
.rootNodeLinkStyle a:link
{
color: Red;
}

.rootNodeLinkStyle a:hover
{
color: pink;
text-decoration:underline;
}

In .aspx: add the css class to the RootNodeStyle as below:

<asp:TreeView ID="trvPILDeepSearch" runat="server" ImageSet="Simple" BackColor="#F8F8F8" BorderWidth="5px" BorderColor="#F8F8F8" LeafNodeStyle-CssClass="leafnode" Width="600px" >
<DataBindings>
<asp:TreeNodeBinding DataMember="Parent" TextField="TEXT" SelectAction="None" />
<asp:TreeNodeBinding DataMember="Child" TextField="TEXT" SelectAction="None" />
</DataBindings>
<RootNodeStyle CssClass="rootNodeLinkStyle" />
</asp:TreeView>

Naidulaxmi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response