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

Programmatic Databinding With Groups

3 Answers 159 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
digitall
Top achievements
Rank 1
digitall asked on 30 Jan 2012, 03:06 AM
I have a basic recurring table with the following columns:

Id
Name
ManagerId (this is an FK contraint to Id on the same table)

The markup for my RadOrgChart is this:

<telerik:RadOrgChart ID="RadOrgChart1" runat="server" DataFieldID="Id" DataTextField="Name" DataFieldParentID="ManagerId" Skin="Windows7" GroupColumnCount="4">
        </telerik:RadOrgChart>

I am doing programmatic data-binding with the following:

this.RadOrgChart1.DataSource = from emp in new TestDataContext().Employees select emp;
this.RadOrgChart1.DataBind();

Is it possible to do groups with this setup? Specifically, while this is only a sample, my OrgChart is far too large to display on a screen with some sample data. What I'm hoping to do is show a visualization where the top entry points to a single group of entries (unknown number of items in this group) below it, that group points to a single group below it (unknown number of items in this group) and so on for up to a specified number of levels. This way the width is fairly static, but it conveys the information I'm trying to display. I'll be binding with specific entities via a WCF service so a declarative datasource isn't an option.

Any suggestions?

3 Answers, 1 is accepted

Sort by
0
digitall
Top achievements
Rank 1
answered on 30 Jan 2012, 02:53 PM
Essentially what I'm hoping to do is this: http://demos.telerik.com/aspnet-ajax/orgchart/examples/columncount/defaultcs.aspx, however I need it to be database-driven (with programatic binding) whereas that demo appears to contain only static data. If possible I'd also like to name each group like "Level #1", "Level #2" and so on.
0
Accepted
Peter Filipov
Telerik team
answered on 01 Feb 2012, 03:30 PM
Hi,

I am not quite sure what you want to achieve. Let me give you an example of my suggestion. In case that your idea is different, please give me more details about how to change it and fit into your scenario.

To have groups you need to use Group-Enabled Binding. The text on them is represented by a RenderedField.

Kind regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
digitall
Top achievements
Rank 1
answered on 01 Feb 2012, 03:35 PM
From a cursory overview that appears to be exactly what I needed. Thanks!
Tags
OrgChart
Asked by
digitall
Top achievements
Rank 1
Answers by
digitall
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or