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

Group Column Count with WCF Service Binding?

1 Answer 13 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 18 Jul 2014, 08:10 PM
Hello,

Is it possible to set the group column count while using the WCF Service Binding? I tried various ways, but its not too obvious how to set the columns in this configuration. GroupColumnCount in the ascx control seems to be ignored.

Any advice is appreciated.

Thanks,
Andy

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 22 Jul 2014, 08:16 AM
Hello,

Here is the code that can be changed in the OrgChartNodeDataService that is setting the ColumnCount of the node:
public OrgChartNodeData[] LoadData(OrgChartNodeData node, IDictionary<string, object> context)
   {
       var employees = GetTeams();
  
       var rows = from myRow in employees.AsEnumerable() where myRow.Field<string>("ReportsTo") == node.Id select new { values = myRow };
  
       var items = new List<OrgChartNodeData>();
  
       foreach (var row in rows)
       {
           var name = row.values.Field<string>("Team");
           var id = row.values.Field<string>("TeamID");
           var loadedNode = new OrgChartNodeData() { Id = id ,ColumnCount=2};
           loadedNode.RenderedFieldsData.Add(new OrgChartRenderedFieldData() { Text = name });
  
           items.Add(loadedNode);
       }
  
       return items.ToArray();
   }

Hope this will be helpful.

Regards,
Plamen
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
Andrew
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or