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

[Solved] Custom aggregate in the column footer (with images)

1 Answer 123 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shane Woodward
Top achievements
Rank 1
Shane Woodward asked on 04 Mar 2010, 12:07 PM
HiTelerik!

I have a GridViewImageColumn column in my grid that is bound to a field containing an enum value (for the example, lets say the enum values are A1, B2 and C3). I need to be able present counts of each of the enum values as a summary in the column footer, and i need to use images.

I have read this postthis post and checked out the Totals example in the RadGridView demo, so i believe i have a reasonably good idea how i will achieve the images - use some bound UI elements inside a AggregateResultsList repeater, translating the bound value using a ValueConverter. Is this the correct approach?

What i do not understand though is how to implement the custom aggregate function to count the number of each of the enum values (i.e. there are 7 A1 values, 10 of B2, etc.). Are you able to give me a pointer in the right direction to create this custom aggregate? Will i need a separate version of the aggregate function to count each set of enum values, or will i be able to pass in a value to instruct the aggregate which enum value to count?

Thanks for any assistance!

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 08 Mar 2010, 02:11 PM
Hi Shane,

I have prepared a small sample project (please find it attached).
It demonstrates a way to count enumerable values and display the results in the footer.
And yes , it uses a separate function for each enum value.

All the best,
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.
Tags
GridView
Asked by
Shane Woodward
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or