Programmatic Databinding With Groups

4 posts, 1 answers
  1. digitall
    digitall avatar
    169 posts
    Member since:
    Jun 2006

    Posted 29 Jan 2012 Link to this post

    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?
  2. digitall
    digitall avatar
    169 posts
    Member since:
    Jun 2006

    Posted 30 Jan 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 01 Feb 2012 Link to this post

    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
  5. digitall
    digitall avatar
    169 posts
    Member since:
    Jun 2006

    Posted 01 Feb 2012 Link to this post

    From a cursory overview that appears to be exactly what I needed. Thanks!
Back to Top