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;
}