Hello,
We have requirement of showing say total of a column at end of children group at each level. Say, our data is geographical sales data, where we want total (sum of children records sales) of each level at the end of children list.
While digging into default template, it seems that grouping is knowingly commented out.
Can someone please let us know best way to achieve this? Either by tempering with template, or some other work-around which would work best?
Please do let me know if anything is unclear.
Regards,
Kinjal.
We have requirement of showing say total of a column at end of children group at each level. Say, our data is geographical sales data, where we want total (sum of children records sales) of each level at the end of children list.
While digging into default template, it seems that grouping is knowingly commented out.
Can someone please let us know best way to achieve this? Either by tempering with template, or some other work-around which would work best?
Please do let me know if anything is unclear.
Regards,
Kinjal.
5 Answers, 1 is accepted
0
Hi Kinjal,
Please check this online example.
If you group the RadGridView there , it will show the group footers with totals .
So in few words , the approach would be :
1. Set the RadGridView.ShowGroupFooters = true;
2. If you are grouping programmatically , you should add the relevant aggregate function to the GroupDescriptor.
3. Or if you rely on the user to group data - then you need to add the relevant aggregate function to the column , and when grouped it will automatically show the aggregate results.
Let me know in case you need additional assistance on that .
Kind regards,
Pavel Pavlov
the Telerik team
Please check this online example.
If you group the RadGridView there , it will show the group footers with totals .
So in few words , the approach would be :
1. Set the RadGridView.ShowGroupFooters = true;
2. If you are grouping programmatically , you should add the relevant aggregate function to the GroupDescriptor.
3. Or if you rely on the user to group data - then you need to add the relevant aggregate function to the column , and when grouped it will automatically show the aggregate results.
Let me know in case you need additional assistance on that .
Kind regards,
Pavel Pavlov
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
Kinjal
Top achievements
Rank 1
answered on 08 Sep 2010, 11:23 AM
Hello Pavel,
Thanks for the quick reply.
I tried the solution you mentioned. I think, i am not able to get the grouping working.
I set, ShowGroupFooters="True", ShowGroupPanel="True"
Also i tried to overwrite GroupHeaderTemplates, etc in hope to see something on screen. What i think the issue is, the Grouping is not taking place. Nor is the GroupPanel is displayed.
To confirm my doubt i set a breakpoint in event handler hooked to Grouping event. Execution never comes there.
Can you shed some light to it?
By the way, i am talking about TreeListView. (didn't mentioned it explicitly in previous post as i posted under it's forum). I hope Grouping works in TreeListView.
Awaiting your reply.
For better communication of idea this is something like what i want:
Name Sales Amount
North
North State 1
NS 1 - Area 1 5,000
NS 1 - Area 2 5,000
Total North State 1 10,000
North State 2
NS 2 - Area 1 2,000
NS 2 - Area 2 3,000
Total North State 2 5,000
Total North 15,000
The bold lines are something i want to achieve. The amounts as you can see are aggregate of its child items.
Also, grouping as you might have imagined is fixed based on Parent-Child relation (equal to ChildTableDefinitions in rad controls world)
Good day!
Regards,
Kinjal.
Thanks for the quick reply.
I tried the solution you mentioned. I think, i am not able to get the grouping working.
I set, ShowGroupFooters="True", ShowGroupPanel="True"
Also i tried to overwrite GroupHeaderTemplates, etc in hope to see something on screen. What i think the issue is, the Grouping is not taking place. Nor is the GroupPanel is displayed.
To confirm my doubt i set a breakpoint in event handler hooked to Grouping event. Execution never comes there.
Can you shed some light to it?
By the way, i am talking about TreeListView. (didn't mentioned it explicitly in previous post as i posted under it's forum). I hope Grouping works in TreeListView.
Awaiting your reply.
For better communication of idea this is something like what i want:
Name Sales Amount
North
North State 1
NS 1 - Area 1 5,000
NS 1 - Area 2 5,000
Total North State 1 10,000
North State 2
NS 2 - Area 1 2,000
NS 2 - Area 2 3,000
Total North State 2 5,000
Total North 15,000
The bold lines are something i want to achieve. The amounts as you can see are aggregate of its child items.
Also, grouping as you might have imagined is fixed based on Parent-Child relation (equal to ChildTableDefinitions in rad controls world)
Good day!
Regards,
Kinjal.
0
Hello Kinjal,
Please excuse me for the misunderstanding !
On a second read I found that I answered you in the context of RadGridView, rather than of RadTreeListView. Although both controls are very similar ( RadTreeListView is based on RadGridView) ,
unfortunately grouping is not yet supported by RadTreeListView.
However looking at your description , I may suggest to try RadGridView , instead of RadTreeListView. Using the grouping feature of RadGridView a layout similar to yours may be achieved ( e.g. using a GridView with two level grouping - one by region and one by state with the aggregates turned on as described in my previous answer.
If you find trouble implementing this , just let me know and I will prepare a small sample app for you ( using RadGridView).
Sincerely yours,
Pavel Pavlov
the Telerik team
Please excuse me for the misunderstanding !
On a second read I found that I answered you in the context of RadGridView, rather than of RadTreeListView. Although both controls are very similar ( RadTreeListView is based on RadGridView) ,
unfortunately grouping is not yet supported by RadTreeListView.
However looking at your description , I may suggest to try RadGridView , instead of RadTreeListView. Using the grouping feature of RadGridView a layout similar to yours may be achieved ( e.g. using a GridView with two level grouping - one by region and one by state with the aggregates turned on as described in my previous answer.
If you find trouble implementing this , just let me know and I will prepare a small sample app for you ( using RadGridView).
Sincerely yours,
Pavel Pavlov
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
Kinjal
Top achievements
Rank 1
answered on 08 Sep 2010, 01:26 PM
Hello Pavel,
No problem, i half doubted that.. (The TreeListView/GridView confusion).
Well, my data is not limited to two levels.. The number of levels would be dynamic actually, expecting at least 10 level.. (surely don't want to hard-code on number of levels)
Do i still have hopes?
Or in other words, is there a better way to do this? I have one crafty idea (yet to experiment). I am thinking to duplicate all parent-objects so that there is extra item (to represent footer at each level), and do totaling in the code.. Surely not a clean implementation but want to get there anyways..
Hoping for a better way out..
Regards,
Kinjal.
No problem, i half doubted that.. (The TreeListView/GridView confusion).
Well, my data is not limited to two levels.. The number of levels would be dynamic actually, expecting at least 10 level.. (surely don't want to hard-code on number of levels)
Do i still have hopes?
Or in other words, is there a better way to do this? I have one crafty idea (yet to experiment). I am thinking to duplicate all parent-objects so that there is extra item (to represent footer at each level), and do totaling in the code.. Surely not a clean implementation but want to get there anyways..
Hoping for a better way out..
Regards,
Kinjal.
0
Hello Kinjal,
Having so many levels to display makes me NOT recommend the solution with groups.
Maybe in this case , your hack with doubled items would be the better approach.
Best wishes,
Pavel Pavlov
the Telerik team
Having so many levels to display makes me NOT recommend the solution with groups.
Maybe in this case , your hack with doubled items would be the better approach.
Best wishes,
Pavel Pavlov
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