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

[Solved] Custom Column - aggregate function

2 Answers 89 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.
Justin Lee
Top achievements
Rank 1
Justin Lee asked on 16 Aug 2011, 06:45 PM
I have a unusual senario that I'm hoping you can help with.  I have a grid with dynamic columns.  The value in each cell is calculated using the column and the row (dataitem).  So I created a custom column class (inherit GridViewBoundColumnBase), which overrides the CreateCellElement method where the value is calculated based on the column info and the dataItem, and a TextBlock displaying the value is returned.

This works great - no problems.  But I have a requirement to add a total's row.  (the values are decimals)

Is there any way to accomplish this? The sumfunction class expects a property name - which I don't have.  Is it possible to create a custom aggregate class?  If so, are there any examples?

Thanks,
Justin

2 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 17 Aug 2011, 04:07 PM
Hi Justin Lee,

Depending on your specific requirements and settings, you may try to define a custom generic aggregate expression. Please take a look at this forum thread for a reference.
 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Justin Lee
Top achievements
Rank 1
answered on 17 Aug 2011, 05:42 PM
The solution in that thread worked for me. Thanks!
Tags
GridView
Asked by
Justin Lee
Top achievements
Rank 1
Answers by
Maya
Telerik team
Justin Lee
Top achievements
Rank 1
Share this question
or