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

Org chart with a large dataset

2 Answers 212 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Sree
Top achievements
Rank 1
Sree asked on 03 Jun 2012, 12:08 AM
I trying to bind the orgChart to a large dataset and doesn't seem to work. The dataset contains about 150000 rows. I am using the latest Q2 Beta.
<telerik:RadOrgChart ID="RadOrgChart1" runat="server" EnableCollapsing="true" LoadOnDemand="NodesAndGroups" Skin="Office2010Blue">

 </telerik:RadOrgChart>

 

 protected void Page_Load(object sender, EventArgs e)
    {
        BindToDataSet(this.RadOrgChart1);
    }

    private static void BindToDataSet(RadOrgChart orgChart)
    {
        string dbConnectionString = ConfigurationManager.ConnectionStrings["mambophilprod"].ConnectionString;
        MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT Id, ParentId, CurrentPosition From mambophil_flat_tree",
                                                    dbConnectionString);

        DataSet links = new DataSet();
        adapter.Fill(links);

        orgChart.DataTextField = "CurrentPosition";
        orgChart.DataFieldID = "Id";
        orgChart.DataFieldParentID = "ParentID";

        orgChart.DataSource = links;
        orgChart.DataBind();
    }

This is what I would like to do.
- I want to show the first few levels (say 10)
- When the user clicks on one of the last levels, the system fetches the next 10 levels.

Is this possible? Appreciate your help.
Sree

2 Answers, 1 is accepted

Sort by
0
Sree
Top achievements
Rank 1
answered on 03 Jun 2012, 06:01 PM
By looking at some of the examples, I was able to work around the problem by setting the MaxDataBindDepth property. I am running into another problem with the ordering of the child nodes. I am trying to display a BinaryTree and I want to display the leftNode followed by RightNode. The left and Right positions are in the database record for every node and they share the same parentID.

For example, this is my database structure:-

Id        ParentID    Position    Text
1          null             Top         Root
2         1                  Left        L1
3         1                  Right      R1

My rendered tree looks like this:
                       Root
                L1              R1

In this case, both L1 and R1 share the same parentID and I want to preserve the order for the children (Left followed by Right).
     
Thanks!
anuj
Top achievements
Rank 1
commented on 01 Jun 2023, 06:20 AM | edited

@Sree Can you share your solution. I am facing the same problem.

I have large dataset and i do not want to load all the nodes on page load.

0
Peter Filipov
Telerik team
answered on 06 Jun 2012, 03:27 PM
Hello Sree,

I am glad to hear that you solved your first issue.
Regarding the your second question the child nodes are rendered in the order of their position in the data table. RadOrgChart does not support reordering of the nodes position.

All the best,
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.
Tags
OrgChart
Asked by
Sree
Top achievements
Rank 1
Answers by
Sree
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or