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

Node color change Telerik Org chart

1 Answer 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sourav
Top achievements
Rank 1
Sourav asked on 26 Jun 2014, 10:12 AM
Hi there,

 I want to change different node color for different node in telerik ORG chart. Like Node A -> pink, Node B -> Red.

Can I do this on GroupItemDataBound event ? if yes then please give me some example ..

Thanks in Advance
Sourav

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 01 Jul 2014, 07:46 AM
Hello Sourav,

You could use the GroupItemDataBound event handler, in order to assign a custom CssClass to the currently evaluated Item. Thus, you could apply the css style rules in your markup and achieve the desired functionality:

//code-behind
protected void radOrgChart_GroupItemDataBound(object sender, Telerik.Web.UI.OrgChartGroupItemDataBoundEventArguments e)
  {
      if (e.Item.Text == "Andrew Fuller")
          e.Item.CssClass = "GreenClass";
      else
          e.Item.CssClass = "RedClass";
  }
//css
<style type="text/css">
       html .RedClass {
           background-color: red;
       }
 
       html .GreenClass {
           background-color: green;
       }
       html .RadOrgChart_Default .rocItemContent,
       html .RadOrgChart_Default .rocItemTemplate {
           background-image: none;
           background-color: transparent;
       }
   </style>


Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Sourav
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or