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

[Solved] How to change treeview's node color?

2 Answers 613 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Fonny
Top achievements
Rank 1
Fonny asked on 29 Jan 2008, 09:18 PM
My treeview uses skin = MAC. And, I changed the fore color = white. However, it does apply. How can I change the node's font color?

2 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 30 Jan 2008, 12:39 PM
Hi Fonny,

First of all you should set the EnableEmbeddedSkins property of RadTreeView to false, so RadTreeView will not be using the embedded skins. See the datailed description here:
http://www.telerik.com/help/radcontrols/prometheus/?HowSkinsWork.html
http://www.telerik.com/help/radcontrols/prometheus/?SkinRegistration.html

Then, you should modify the TreeView.Mac.css file and add the following line to the RadTree_Mac css class:

.RadTreeView_Mac  
{  
    font:11px tahoma,verdana,sans-serif;  
    color:#000;  
    line-height:15px;  
    color:Red;  
      
See for a reference the following hepl topic:
http://www.telerik.com/help/radcontrols/prometheus/?ModifyingExistingSkins.html

Hope this helps.

Regards,
Helen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fernandes
Top achievements
Rank 1
answered on 30 Jan 2008, 12:41 PM
Hi Fonny,

I was able to change the Treeview font color like you want. Just set the "ForeColor" to white, so maybe I'm not understanding your question ;)

Here, it displays an "invisible" treeview since the background is white too.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="changeFontColor.aspx.cs" Inherits="changeFontColor" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Font Color demo</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server" />     
    <div> 
        <telerik:radtreeview id="RadTreeView1" runat="server" loadingstatusposition="BeforeNodeText" ForeColor="White" Skin="Mac"><Nodes> 
<telerik:RadTreeNode runat="server" Text="My Root Node" ExpandMode="ClientSide" Expanded="True"><Nodes> 
<telerik:RadTreeNode runat="server" Text="My child node 1" ExpandMode="ClientSide"></telerik:RadTreeNode> 
<telerik:RadTreeNode runat="server" Text="My child node 2" ExpandMode="ClientSide"></telerik:RadTreeNode> 
</Nodes> 
</telerik:RadTreeNode> 
</Nodes> 
 
<CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation> 
 
<ExpandAnimation Type="OutQuart" Duration="100"></ExpandAnimation> 
</telerik:radtreeview> 
      
    </div> 
    </form> 
</body> 
</html> 

Fernandes
Tags
TreeView
Asked by
Fonny
Top achievements
Rank 1
Answers by
Helen
Telerik team
Fernandes
Top achievements
Rank 1
Share this question
or