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

Summing up parents and children

7 Answers 122 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 04 Aug 2010, 03:52 PM
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.

7 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 04 Aug 2010, 03:56 PM
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
0
Kristjan Einarsson
Top achievements
Rank 1
answered on 04 Aug 2010, 03:59 PM
Thought as much, just wanted to be sure.

Are there any plans implement hierarchical aggregation ?

Regards
Kristján.
0
Miroslav
Telerik team
answered on 09 Aug 2010, 10:00 AM
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
0
Kristjan Einarsson
Top achievements
Rank 1
answered on 21 Sep 2010, 03:54 PM
Ok thanks for letting me know.
0
TSRG - IT
Top achievements
Rank 1
answered on 29 Sep 2010, 11:58 PM
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.
0
Kristjan Einarsson
Top achievements
Rank 1
answered on 30 Sep 2010, 09:35 AM
thanks Timothy,

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

cheers
kristján

0
Vamshi
Top achievements
Rank 1
answered on 26 Jun 2013, 04:57 PM
Hey TSRG - IT

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

Thanks
Tags
TreeListView
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Kristjan Einarsson
Top achievements
Rank 1
TSRG - IT
Top achievements
Rank 1
Vamshi
Top achievements
Rank 1
Share this question
or