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

Aggregate function and Sorting

2 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vinod Sardar
Top achievements
Rank 1
Vinod Sardar asked on 09 Mar 2010, 10:03 AM
Hi,

Country,Team,Loss,Win as a columns. I am grouping on "country" column and am using the aggregate function (Count/Sum) on "Win" columns. my requirement is to sort the country based on the aggreagte function (in this case Count/Sum of "Win" column).
I could use the Aggreagte function but not sure about how to sort the grid based on this aggregate function

Anybody has any idea as to How to sort based on the aggregate function.

Please let me know if you need more information, 



2 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 11 Mar 2010, 12:18 PM
Hi Vinod

In 2010.Q1 we have introduced an extensibility point which allows you to sort the groups using a custom LINQ expressions. I'm sending you an example project which illustrates how to sort the groups by their first aggregate function. Feel free to modify the code for your needs.

Hope this helps,
Stefan Dobrev
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
carla
Top achievements
Rank 1
answered on 15 Jun 2011, 01:37 AM
It actually works the first time the grid is loaded but when the user tries to change the column to be grouped, the aggregation is gone. At which event would be best to add sort if the grouping changes.
Tags
GridView
Asked by
Vinod Sardar
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
carla
Top achievements
Rank 1
Share this question
or