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

multiple orgchart showing only the 2 first

1 Answer 60 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Thierry
Top achievements
Rank 1
Thierry asked on 09 Apr 2014, 12:49 PM
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();







1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 11 Apr 2014, 11:44 AM
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.

 
Tags
OrgChart
Asked by
Thierry
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or