Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
get the count of Chart
posted

hello,

kindly i want to ask about how can i get the nodes count of XamOrgChart.

thank you

Parents
  • 22852
    Verified Answer
    Offline posted

    Hello,

    You can use a recursive function to count the nodes:

    private int GetNodeCount(Infragistics.Controls.Maps.OrgChartNode node)
    {
        int count = 0;
        if (node != null)
        {
            count = 1;
            foreach (var childNode in node.ChildNodes)
            {
                count += GetNodeCount(childNode);
            }
        }
        return count;
    }

    Let me know if you have any questions with this matter.

Reply Children