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

Sorting a Grouped grid by AggregateFunction

1 Answer 161 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.
Martyn
Top achievements
Rank 1
Martyn asked on 27 Feb 2012, 12:42 PM
Hi, I have a grid that is sorted by 2 columns ("Dealer", "Carline") , and in the first column sort I have an aggregate function that gives the sum of all "ProjOverspend" in the group title, what I'd like to do is have the list (Dealers) ordered by this number in Descending order, here's my Group/Sort descriptor code;

<telerik:RadGridView.GroupDescriptors>
    <telerik:GroupDescriptor Member="DealerName">
        <telerik:GroupDescriptor.AggregateFunctions>
            <telerik:SumFunction SourceField="ProjOverspend" Caption="Total Projected Overspend: " ResultFormatString="{}{0:C2}" FunctionName="AggProjOverspend"/>
        </telerik:GroupDescriptor.AggregateFunctions>
    </telerik:GroupDescriptor>
    <telerik:GroupDescriptor Member="Carline" SortDirection="Ascending" />
</telerik:RadGridView.GroupDescriptors>
<telerik:RadGridView.SortDescriptors>
    <telerik:SortDescriptor Member="AggProjOverspend" SortDirection="Descending" />
</telerik:RadGridView.SortDescriptors>

I was hoping this would then sort the Top Level grouping by AggProjOverspend however this doesn't happen, there doesn't seem to be any sorting at all.

I hope this is enough info to show what I mean.

Hope you can help,

Thanks :)

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 27 Feb 2012, 12:55 PM
Hello Martyn,

Please take a look at this forum thread for a reference. 

Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Martyn
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or