RadOrgChart remove rendered fields for some node in NodeDataBound

4 posts, 0 answers
  1. Mira
    Mira avatar
    5 posts
    Member since:
    Feb 2013

    Posted 11 Apr 2014 Link to this post

    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
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 15 Apr 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mira
    Mira avatar
    5 posts
    Member since:
    Feb 2013

    Posted 16 Apr 2014 in reply to Boyan Dimitrov Link to this post

    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.







  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 16 Apr 2014 Link to this post

    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.

     
Back to Top