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

Problem with Line and remove GroupItem

2 Answers 216 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Renato
Top achievements
Rank 1
Renato asked on 27 Mar 2017, 07:33 PM

Hello,

I'm using try version and I found two problem and would like your help.

1. My line disappears when I have more four sub items (see example)

2.This example is more difficult to explain because but I try. 

I have structure (see image  OrgChart4.PNG) and I need that my orgChart stay as OrgChart1.PNG, group by Header (like "Operacional") but some other "Operacional" groups name are in blank.

What is happening?

Regars,

Renato Vilela

 

List<Structure> lsStructure;
 
CreateOrg(lsStructure);
 
private void CreateOrg(List<Structure> lsStructure){
 
DataTable nodeTable = CreateNode(lsStructure);
            DataTable itemsTable = CreateItems(lsStructure);
 
            rocKAS.GroupEnabledBinding.NodeBindingSettings.DataFieldID = Support.GetMemberName((Structure c) => c.EnteID).ToString();
            rocKAS.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = Support.GetMemberName((Structure c) => c.EnteParentID).ToString();
            rocKAS.GroupEnabledBinding.NodeBindingSettings.DataSource = nodeTable;
 
            //Nome das Pessoas
            rocKAS.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = Support.GetMemberName((Structure c) => c.EnteID).ToString();
            rocKAS.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = Support.GetMemberName((Structure c) => c.DivisionID).ToString();
            rocKAS.RenderedFields.NodeFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "Division" });
            rocKAS.GroupEnabledBinding.GroupItemBindingSettings.DataSource = itemsTable;
 
            rocKAS.DataBind();
            rocKAS.CollapseAllNodes();
 
}
 
 
private DataTable CreateNode(List<Structure> lsStructure)
        {
            DataTable nodeTable = new DataTable();
            DataRow row;
 
            nodeTable.Columns.Add(Support.GetMemberName((Structure c) => c.EnteID).ToString(), typeof(int));
            nodeTable.Columns.Add(Support.GetMemberName((Structure c) => c.EnteParentID).ToString(), typeof(int));
            nodeTable.Columns.Add(Support.GetMemberName((Structure c) => c.DivisionID).ToString(), typeof(int));
            nodeTable.Columns.Add(Support.GetMemberName((Structure c) => c.Division).ToString(), typeof(string));
 
            foreach (var item in lsStructure)
            {
                row = nodeTable.NewRow();
                row[Support.GetMemberName((Structure c) => c.EnteID).ToString()] = item.EnteID;
                row[Support.GetMemberName((Structure c) => c.DivisionID).ToString()] = item.DivisionID;
                row[Support.GetMemberName((Structure c) => c.Division).ToString()] = item.Division;
 
                if(item.EnteParentID == 0)
                    row[Support.GetMemberName((Structure c) => c.EnteParentID).ToString()] = DBNull.Value;
                else
                    row[Support.GetMemberName((Structure c) => c.EnteParentID).ToString()] = item.EnteParentID;
 
                nodeTable.Rows.Add(row);
            }
 
            return nodeTable;
        }
 
        private DataTable CreateItems(List<Structure> lsStructure)
        {
            DataTable itemsTable = new DataTable();
            DataRow row;
 
            itemsTable.Columns.Add(Support.GetMemberName((Structure c) => c.EnteID).ToString(), typeof(int));
            itemsTable.Columns.Add(Support.GetMemberName((Structure c) => c.EnteParentID).ToString(), typeof(int));
            itemsTable.Columns.Add(Support.GetMemberName((Structure c) => c.EntePosition).ToString(), typeof(string));
            itemsTable.Columns.Add(Support.GetMemberName((Structure c) => c.Division).ToString(), typeof(string));
            itemsTable.Columns.Add(Support.GetMemberName((Structure c) => c.DivisionID).ToString(), typeof(Int16));
            itemsTable.Columns.Add(Support.GetMemberName((Structure c) => c.EnteName).ToString(), typeof(string));
 
            foreach (var item in lsStructure)
            {
                row = itemsTable.NewRow();
                row[Support.GetMemberName((Structure c) => c.EnteID).ToString()] = item.EnteID;
                row[Support.GetMemberName((Structure c) => c.EnteParentID).ToString()] = item.EnteParentID;
                row[Support.GetMemberName((Structure c) => c.EntePosition).ToString()] = item.EntePosition;
                row[Support.GetMemberName((Structure c) => c.Division).ToString()] = item.Division;
                row[Support.GetMemberName((Structure c) => c.DivisionID).ToString()] = item.DivisionID;
                row[Support.GetMemberName((Structure c) => c.EnteName).ToString()] = item.EnteName;
                itemsTable.Rows.Add(row);
            }
 
            return itemsTable;
        }

2 Answers, 1 is accepted

Sort by
0
Renato
Top achievements
Rank 1
answered on 27 Mar 2017, 07:42 PM

I forgot...

My browser is Chrome or IE11 and Telerik Trial is 2017.1.228 Feb 28, 2017

Tks.

0
Peter Milchev
Telerik team
answered on 30 Mar 2017, 01:58 PM
Hello Renato,

We have answered you in the duplicate support thread.

Once we have any resolution on the issue there, we can share it here for convenience and better visibility from the community.

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
OrgChart
Asked by
Renato
Top achievements
Rank 1
Answers by
Renato
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or