Summing up parents and children

8 posts, 1 answers
  1. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 04 Aug 2010 Link to this post

    Hi,
    I have a question about the functionality of TreeListView.

    (As seen in the picture). If I would change the Carrot value to 800, can I let the Vegetables value change/sum up automatically ?

    And could increase/decrease the value of the Vegetables and increase the value of the children ?

    Is there any simple built-in solution for this ?

    Best regards
    kristján.
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 04 Aug 2010 Link to this post

    Hi Kristjan Einarsson,

    Unfortunately there is no built-in hierarchical aggregation. You need to implement this in your ViewModel.

    Greetings,
    Miroslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 04 Aug 2010 Link to this post

    Thought as much, just wanted to be sure.

    Are there any plans implement hierarchical aggregation ?

    Regards
    Kristján.
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 09 Aug 2010 Link to this post

    Hi Kristjan Einarsson,

    No, there are no plans for hierarchical aggregation for Q3 and we have not made any plans beyond it yet.

    Greetings,
    Miroslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 21 Sep 2010 Link to this post

    Ok thanks for letting me know.
  7. TSRG - IT
    TSRG - IT avatar
    26 posts
    Member since:
    Nov 2009

    Posted 29 Sep 2010 Link to this post

    Hi Kristjan,

    If you're still struggling with this problem it isn't too hard, I managed to implement this into the TreeListView I am using. I've used a recursive function to sum of rows from the bottom up so to speak. I first sum all the children then traverse up the tree to the root node. It goes something like this...

    void GetTotals(object node)
    {
    if (node.Items.Count > 0)
    {
    foreach (item in node.Items)
    {
    GetTotals(item);
    }
    TotalChildrenNodes(node);
    }
    }

    To dynamically update totals you'll have determine the updated node's ancestors.

    Hope it helps.

    Cheers,

    Tim.
  8. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 30 Sep 2010 Link to this post

    thanks Timothy,

    well I outsourced it to the guy sitting next to me :) I'll give him the info.

    cheers
    kristján

  9. Vamshi
    Vamshi avatar
    7 posts
    Member since:
    Feb 2012

    Posted 26 Jun 2013 Link to this post

    Hey TSRG - IT

    Do you have any idea for getting node children count after applying column filter?

    Thanks
Back to Top
UI for WPF is Visual Studio 2017 Ready