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

[Solved] Sum Group Headers

3 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
phil doc
Top achievements
Rank 1
phil doc asked on 28 Jun 2009, 06:10 PM
Sorry fellas I'm sure this has been answered somewhere but I can't find a clear example.

I have a grid full of data, what I would like to do is group it by a column and to have the group header show sum() data in the column it relates to rather than appended to the end of the group header as its hard to read when the group headers are a different length.

Hope this makes sense, for example if I had the following grid of data

Project       Time    Value
Red            2          3
Red            2          3
Orange      4          10
Orange      4          10

I would want to see this when the Project field is grouped

Project         Time   Value
+Red             4        6
+Orange       8        20

Instead of

Project       Time    Value
+Red,Time:4,Value:6
+Orange,Time:8,Value:20

You can see the values are in their relevant column, I've done it with other grids just wondering how to do it with this one,

Ta




3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Jun 2009, 05:22 AM
Hello Phil,

Check out the following help link which explains on how you can use the ItemDataBound event to make calculations and add them to the group headers:
Performing calculations in group header

Thanks
Princy.
0
phil doc
Top achievements
Rank 1
answered on 29 Jun 2009, 08:14 AM
Hi,

Thanks for that but I am already able to do that, what I need is something which lays out the value in the column in relates to not just in a long string in the header.

Maybe this isn't possible with telerik as I've looked everywhere for a solution but I can't find anything.

Help!
0
phil doc
Top achievements
Rank 1
answered on 29 Jun 2009, 08:23 AM
Maybe I should give another example -

if I had the following grid of data

Project       Time    Value    Items
Red            2          3           5 
Red            2          3           5
Orange      4          10         15
Orange      4          10         15

I would want to see this when the Project field is grouped and the Time and Items fields are summed (Value is not calculated)

Project         Time   Value   Items
+Red             4            10
+Orange       8            30

Instead of

Project       Time    Value    Items
+Red,Time:4,Items:10
+Orange,Time:8,Items:30


You can see the layout I want is alot clearer than what the grid is giving me at the moment. 
Tags
Grid
Asked by
phil doc
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
phil doc
Top achievements
Rank 1
Share this question
or