This is a migrated thread and some comments may be shown as answers.
RadOrgChart remove rendered fields for some node in NodeDataBound
3 Answers 11 Views
This is a migrated thread and some comments may be shown as answers.
Mira
Top achievements
Rank 1
Mira asked on 11 Apr 2014, 01:36 PM
I have an OrgChart  with 2 rendered fields. Am trying to remove the rendered fields for the Root node. i tried to access the node's rendered fields  in the nodeDataBound event, but its not working:

example:

  if (e.Node.ID == "Parent")
            {
                for (int i = e.Node.GroupItems[0].RenderedFields.Count - 1; i >= 0; i--)
                {
                    e.Node.GroupItems[0].RenderedFields[i] = new OrgChartRenderedField();
                }
            }

Thanks
Mira

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 15 Apr 2014, 04:22 PM
Hello,

Could you please elaborate a bit more on your scenario? Knowing what functionality you are trying to achieve we can give you appropriate solution for your case.

Regards,
Boyan Dimitrov
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.

 
0
Mira
Top achievements
Rank 1
answered on 16 Apr 2014, 05:24 AM
Hey,

We have an orgchart with more than one ROOT (null parent), since the orgchart doesn't support this functionality to solve this we linked all
the nodes to one parent root. However, I dont want to show any rendered fields for this root because its not real data.

I bind the orgchart using:
RadOrgChart.RenderedFields.ItemFields.Add(new OrgChartRenderedField() { DataField = "JobTitle", Label="Job" });
RadOrgChart.RenderedFields.ItemFields.Add(new OrgChartRenderedField() { DataField = "replacement", Label = "Replacement" });

I need to remove the rendered fields for the parent node only.







0
Boyan Dimitrov
Telerik team
answered on 16 Apr 2014, 02:27 PM
Hello Mira,

An easy and convenient way of achieving such functionality would be to use JavaScript and css. Please add this line of code in the client-side pageLoad event handler as shown in the code snippet:
//JavaScript
function pageLoad() {
    $telerik.$(".rocRootNode .rocNodeFields")[0].style.visibility = "hidden";
}

Hope that this will be helpful.

Regards,
Boyan Dimitrov
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.

 
Asked by
Mira
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Mira
Top achievements
Rank 1
Share this question
or