multiple orgchart showing only the 2 first

2 posts, 0 answers
  1. Thierry
    Thierry avatar
    1 posts
    Member since:
    Jul 2010

    Posted 09 Apr 2014 Link to this post

    Hi,

    we want to place 4 orgchart controls on the same page and only the 2 first appears.
    The strange thing is that html tags are here but there is a visibility problem on the div with "rocViewPort" class.

    Does anybody has already had this problem ?

    Here is our code :

    <telerik:RadOrgChart runat="server" ID="RadOrgChart1" GroupColumnCount="1" />
    <telerik:RadOrgChart runat="server" ID="RadOrgChart2" GroupColumnCount="1" />
    <telerik:RadOrgChart runat="server" ID="RadOrgChart3" GroupColumnCount="1" />
    <telerik:RadOrgChart runat="server" ID="RadOrgChart4" GroupColumnCount="2" />
     
    <asp:SqlDataSource id="SqlDataSource1" Runat="server" SelectCommand="SELECT id, idGroupe, nom, prenom, poste FROM INT_OrgEmployes" ConnectionString="<%$ ConnectionStrings:Intranet %>" ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" /> 
    <asp:SqlDataSource id="SqlDataSource5" Runat="server" SelectCommand="SELECT id, idParent, nom FROM INT_OrgGroupes WHERE idOrg=1" ConnectionString="<%$ ConnectionStrings:Intranet %>" ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" />
    <asp:SqlDataSource id="SqlDataSource6" Runat="server" SelectCommand="SELECT id, idParent, nom FROM INT_OrgGroupes WHERE idOrg=2" ConnectionString="<%$ ConnectionStrings:Intranet %>" ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" />
    <asp:SqlDataSource id="SqlDataSource7" Runat="server" SelectCommand="SELECT id, idParent, nom FROM INT_OrgGroupes WHERE idOrg=3" ConnectionString="<%$ ConnectionStrings:Intranet %>" ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" />
    <asp:SqlDataSource id="SqlDataSource8" Runat="server" SelectCommand="SELECT id, idParent, nom FROM INT_OrgGroupes WHERE idOrg=4" ConnectionString="<%$ ConnectionStrings:Intranet %>" ProviderName="<%$ ConnectionStrings:Intranet.ProviderName %>" />

    ArrayList listOrg = new ArrayList();
     
    listOrg.Add(RadOrgChart1);
    listOrg.Add(RadOrgChart2);
    listOrg.Add(RadOrgChart3);
    listOrg.Add(RadOrgChart4);
     
    foreach (RadOrgChart unOrg in listOrg)
    {
        unOrg.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "id";
        unOrg.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "idGroupe";
        unOrg.GroupEnabledBinding.GroupItemBindingSettings.DataTextField = "nom";
        unOrg.RenderedFields.ItemFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "poste" });
        unOrg.GroupEnabledBinding.GroupItemBindingSettings.DataSource = SqlDataSource1;
    }
     
    RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "id";
    RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "idParent";
    RadOrgChart1.RenderedFields.NodeFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "nom" });
    RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = SqlDataSource5;
    RadOrgChart1.DataBind();
     
    RadOrgChart2.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "id";
    RadOrgChart2.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "idParent";
    RadOrgChart2.RenderedFields.NodeFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "nom" });
    RadOrgChart2.GroupEnabledBinding.NodeBindingSettings.DataSource = SqlDataSource6;
    RadOrgChart2.DataBind();
     
    RadOrgChart3.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "id";
    RadOrgChart3.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "idParent";
    RadOrgChart3.RenderedFields.NodeFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "nom" });
    RadOrgChart3.GroupEnabledBinding.NodeBindingSettings.DataSource = SqlDataSource7;
    RadOrgChart3.DataBind();
     
    RadOrgChart4.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "id";
    RadOrgChart4.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "idParent";
    RadOrgChart4.RenderedFields.NodeFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "nom" });
    RadOrgChart4.GroupEnabledBinding.NodeBindingSettings.DataSource = SqlDataSource8;
    RadOrgChart4.DataBind();







  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 11 Apr 2014 Link to this post

    Hello Thierry,

    The issue comes due to a javascript error which is caused because you second OrgChart control has two root nodes which is not supported. Please review the attached project and notice that if you remove the second root node of the second OrgChart component everything is working fine.
    To resolve the issue review your data and structure it in a way to have only one root node.


    Regards,
    Peter Filipov
    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
Back to Top