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

dynamic change color

1 Answer 105 Views
SiteMap
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 29 Jul 2013, 04:01 PM
I have a problem, I would like to change the font color dynamically:

<telerik:RadSiteMap ID="BreadCrumbSiteMap" runat="server" DataTextField="Text"

DataNavigateUrlField="NavigateUrl">

<DefaultLevelSettings ListLayout-RepeatDirection="Horizontal" SeparatorText="/" Layout="Flow" />

</telerik:RadSiteMap >

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

     BreadCrumbSiteMap.Style.Add("color", "#000000")
End Sub

 not  Work
how can I do?

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 30 Jul 2013, 08:33 AM
Hello Michele,

I noticed that you also send us a support ticket regarding the same issue. I will paste the answer that I provided in the ticket so that anyone else interested in the solution can refer to it:

You can find the specific node of the RadSiteMap control and set the CssClass property to any css class. Below you can find an example on how to achieve this. You will also need to add the following css class selector so that the changes can take effect:

code behind:

//finds the first child o fthe first root node
        RadSiteMap1.Nodes[0].Nodes[0].CssClass = "new";

css:
div.RadSiteMap .rsmTwoLevels .rsmLevel1 .rsmItem.new {
           /*here you can set the desired font-size and/or color, it applies only for the first level of nodes*/
       }


Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
SiteMap
Asked by
Michele
Top achievements
Rank 2
Answers by
Kate
Telerik team
Share this question
or