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

Group By sort order

30 Answers 377 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin Meyer
Top achievements
Rank 1
Kevin Meyer asked on 02 May 2008, 08:29 PM
I need to order groups by something other than the field used to group by.  For example, assume I have a list of Customers with non-unique names.  I group on Customer Id, but display Customer Name.  I need to order on the customer's name, not the Id.  What's the recommended approach for doing this with Q1 2008?

30 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 05 May 2008, 09:06 AM
Hi Kevin,

The functionality you are looking for cannot currently be achieved. It requires a mechanism for setting dependencies between fields.

Grouping by more than one field will be introduced in one of our future releases:
 
Example:
    "CustomerID, CustomerName Group by CustomerName DESC, CustomerID"

This expression currently generates two grouping levels (one for CustomerName and one sub-level for CustomerID). This, however will change to a single level of grouping, where CustomerName and CustomerID will be the same, and sorting will be done on CustomerName, then by CustomerID.

If you have any additional questions, please contact me.

Kind regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
tpowell
Top achievements
Rank 1
answered on 16 Sep 2008, 11:11 PM
We have this same issue in our application, we group by their id but want it ordered by their last name. This was originally posted back in may. Is this issue fixed in Q2?
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 17 Sep 2008, 09:30 AM
Posted that before but thought it would fit in well with the
grouping/sorting discussion:

I would like to be able to interactively sort the groups by their count()
aggregate. For example groups containing the most items first.

Erwin
0
Julian Benkov
Telerik team
answered on 19 Sep 2008, 02:47 PM
Hello guys,

This feature is still not supported in the current RadGridView version, however we plan to start extending the sorting/grouping operations after the Q3 2008 release.

Currently our focus is on RadGridView virtualization, on-demand hierarchy loading, custom sorting/grouping/filtering from user code, and row templates.

Thank for the votes. We will do our best to implement this feature as soon as possible.
 

Regards,
Julian Benkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jim
Top achievements
Rank 1
answered on 21 Sep 2008, 05:51 AM
Hi guys -

Just one more vote for this functionality - desparately needed for our new app.

- Jim
0
Paul
Top achievements
Rank 1
answered on 05 Dec 2008, 04:27 AM
I want to know that is this function available in Q32008 now? thanks.
0
Julian Benkov
Telerik team
answered on 05 Dec 2008, 03:21 PM
Thank you for the feedback, guys.

This functionality is in our TODO list for next our major release - Q1 2009, due at the end of February.


Sincerely yours,
Julian Benkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
ppan
Top achievements
Rank 1
answered on 11 Feb 2009, 03:46 PM
Any news? Will this feature be available in Q1 2009 version?
0
Julian Benkov
Telerik team
answered on 13 Feb 2009, 09:40 AM
Hello tsitas,

Thank you for your question. The feature will be introduced in Q1 2009 release. Do not hesitate to write me back if you have further questions.

Greetings,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
tommaso
Top achievements
Rank 1
answered on 02 Mar 2009, 12:27 PM
Hi I just downloaded the asp.net Q1 2009 release...
I want to sort fields by the sum() of a group... You said that in Q1 it was possible to do this... how? I really need this feature otherwise I cannot use the telerik grid!!!
tommy
0
Sebastian
Telerik team
answered on 05 Mar 2009, 09:24 AM
Hi tommaso,

Do you have in mind RadGrid ASP.NET AJAX in this case? I reviewed the support communication made through your account and have not found any discussion about "sorting by sum of a group". Can you please clarify what do you have in mind?

If you would like to sort by aggregated values, consider using GridCalculatedColumn as shown on this online demo:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx

You can also sort inside grouped grid and display sum value results as demonstrated here:

http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/expressions/defaultcs.aspx

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
tommaso
Top achievements
Rank 1
answered on 05 Mar 2009, 10:44 AM
hi and thx for the reply but consider the example you provided:
In this example you can order by 

but what I really need is to know which country has the highest totalamout so I would like to order by sum(TotalAmount) DESC...
so USA that has Group Total : $263,546.04 has to be the first and so on...
If it is not possible to do that, the grouping feature in the grid is completely useless... 
tommy

0
Tsvetoslav
Telerik team
answered on 06 Mar 2009, 08:08 AM
Hi tommaso,

I can't think of a way you can do this in the group headers, however, you can sort by total values in the group footers, which is essentially the same thing. An example on how to do this can be found at the following link: Group Footers.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
tommaso
Top achievements
Rank 1
answered on 06 Mar 2009, 01:37 PM
hi thx this is exactly what I wanna do... sorting by total value in the group footer 
but how??? please help me!
tommy

0
Tsvetoslav
Telerik team
answered on 09 Mar 2009, 09:15 AM
Hello tommaso,

Excuse me for having mislead you, indeed RadGrid does not suppot such a sorting of the groups.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Julius
Top achievements
Rank 1
answered on 11 Apr 2013, 04:58 AM
Hi,

Just wondering if this functionality (sorting by field other than the field used to group by) is implemented by now? As I need this urgently, please reply asap.

Thanks
0
Julian Benkov
Telerik team
answered on 15 Apr 2013, 02:10 PM
Hi Julius,

Please give us a more detailed description for which type of application and grid is your question - RadGridView for Winforms or RadGrid for ASP.NET Ajax.

I am looking forward to your reply.

All the best,
Julian Benkov
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Julius
Top achievements
Rank 1
answered on 15 Apr 2013, 10:47 PM
Hi Julian,

It's a web application, so I am using ASP.NET RadGrid. Basically, what I need has been described on the first thread, i.e. I need to sort the group based on other fields that I do not use to group by, e.g. if my GridGroupByField is CompanyID, I want to be able to sort the group by CompanyName.

Hope this is clear.

Thanks
0
Tsvetoslav
Telerik team
answered on 19 Apr 2013, 08:27 AM
Hello Kevin,

You should add a SortExpression to the grid:

<SortExpressions>
     <telerik:GridSortExpression FieldName="CompanyName" />
 </SortExpressions>

Hope it helps.

Greetings,
Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Julius
Top achievements
Rank 1
answered on 22 Apr 2013, 04:46 AM
Hi Tsvetoslav,

I have tried that and it does not work. What I want to do is to sort the grouped by rows. I tried placing that SortExpressions inside the <GroupByExpressions></GroupByExpressions> but it didn't work. Are you clear on what I'm trying to achieve? If not the first entry on this thread clarifies it.

Thanks
0
Tsvetoslav
Telerik team
answered on 24 Apr 2013, 02:31 PM
Hello Kevin,

Unfortunately your requirement is not clear to me. Could you explain in on the following example:
http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/expressions/defaultcs.aspx

Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Julius
Top achievements
Rank 1
answered on 26 Apr 2013, 01:41 AM
Hi Tsvetoslav,

I'm Julius, not Kevin, btw. The example is below:
<GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="Customer" FieldName="CustomerName" SortOrder="Ascending"></telerik:GridGroupByField>
                            <telerik:GridGroupByField FieldAlias="" FieldName="OrderID" SortOrder="None" FormatString="({0})" HeaderValueSeparator=""></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="OrderID" SortOrder="None"></telerik:GridGroupByField>
                        </GroupByFields>                       
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>

So, basically we have a scenario where one customer places many orders, but one order can only be placed by one customer. I want to group by OrderID, but then I want to sort the grouped rows by Customer Name alphabetically. Does this help?
0
Tsvetoslav
Telerik team
answered on 26 Apr 2013, 12:08 PM
Hi Julius,

Thanks for the explanation - just to make sure, you need to group by OrderID but then sort the whole grid on CustomerName. Unfortunately, this is not a supported scenario.

Greetings, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Julius
Top achievements
Rank 1
answered on 29 Apr 2013, 11:16 PM
Hi Tsvetoslav,

Yes, I need to group by OrderID, but sort by CustomerName. Is there any chance that this feature be included in future release, as this has been requested from 4-5 years ago.

Thanks
0
Vasil
Telerik team
answered on 03 May 2013, 08:51 AM
Hi Julius,

The grid can sort the rows inside each group as it is shown in the demo, but the groups can not be sorted by other fields. A group can contain many items, so sorting the groups themselves by another field is not practically possible and not scheduled for implementation.

All the best,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 27 May 2013, 10:54 PM
I repeat my request from a couple of years ago.
In some scenarios it would be nice to be able to sort groups according to aggregates, especially number of records within the group.

Regards
Erwin
0
Robert
Top achievements
Rank 1
answered on 13 Apr 2016, 06:58 PM

Yep, the management team at Telerik has responded to me that this feature would cause the need for a total re-write of their product. As one poster has said above, the lack of this feature renders grouping practically useless.

Here is a link to a competing product which does indeed understand that it is a basic feature of grouping:

Sorting Groups by Summary Values,,,

https://documentation.devexpress.com/#AspNet/CustomDocument4020

 

0
Vasil
Telerik team
answered on 18 Apr 2016, 07:39 AM
Hi Robert,

We will reconsider implementing the feature. Even if such type of data aggregation should be done on database level, to achieve best performance and support true paging capabilities.

Regards,
Vasil
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Hans
Top achievements
Rank 1
Veteran
answered on 12 Sep 2018, 10:03 AM

Hi,

I have the same question as Erwin and Robert.  Since the post of Vasil dates of 2016-04-18, I am wondering where Telerik now stands on this topic.  I am using Telerik UI for WPF.

Regards
Hans

0
Vladimir Stoyanov
Telerik team
answered on 17 Sep 2018, 08:13 AM
Hello Hans,

May I ask you to check out the SortGroupByAggregate RadGridView SDK example? It demonstrates how to sort groups according to the defined aggregate functions.

If that is not what you were going for, may I ask you to open a separate forum thread in the UI for WPF RadGridView section and provide some more details about your exact scenario? 

Thank you in advance for your understanding.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Kevin Meyer
Top achievements
Rank 1
Answers by
Dwight
Telerik team
tpowell
Top achievements
Rank 1
erwin
Top achievements
Rank 1
Veteran
Iron
Julian Benkov
Telerik team
Jim
Top achievements
Rank 1
Paul
Top achievements
Rank 1
ppan
Top achievements
Rank 1
tommaso
Top achievements
Rank 1
Sebastian
Telerik team
Tsvetoslav
Telerik team
Julius
Top achievements
Rank 1
Vasil
Telerik team
Robert
Top achievements
Rank 1
Hans
Top achievements
Rank 1
Veteran
Vladimir Stoyanov
Telerik team
Share this question
or