Group By sort order

29 posts, 0 answers
  1. Kevin Meyer
    Kevin Meyer avatar
    36 posts
    Member since:
    Dec 2007

    Posted 02 May 2008 Link to this post

    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?
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 05 May 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. tpowell
    tpowell avatar
    6 posts
    Member since:
    Aug 2012

    Posted 16 Sep 2008 Link to this post

    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?
  5. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 17 Sep 2008 Link to this post

    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
  6. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 19 Sep 2008 Link to this post

    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.
  7. Jim
    Jim avatar
    1 posts
    Member since:
    Sep 2008

    Posted 21 Sep 2008 Link to this post

    Hi guys -

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

    - Jim
  8. Paul
    Paul avatar
    15 posts
    Member since:
    Aug 2006

    Posted 04 Dec 2008 Link to this post

    I want to know that is this function available in Q32008 now? thanks.
  9. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 05 Dec 2008 Link to this post

    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.
  10. ppan
    ppan avatar
    2 posts
    Member since:
    Jan 2009

    Posted 11 Feb 2009 Link to this post

    Any news? Will this feature be available in Q1 2009 version?
  11. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 13 Feb 2009 Link to this post

    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.
  12. tommaso
    tommaso avatar
    3 posts
    Member since:
    Feb 2009

    Posted 02 Mar 2009 Link to this post

    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
  13. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 05 Mar 2009 Link to this post

    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.
  14. tommaso
    tommaso avatar
    3 posts
    Member since:
    Feb 2009

    Posted 05 Mar 2009 Link to this post

    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

  15. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 06 Mar 2009 Link to this post

    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.
  16. tommaso
    tommaso avatar
    3 posts
    Member since:
    Feb 2009

    Posted 06 Mar 2009 Link to this post

    hi thx this is exactly what I wanna do... sorting by total value in the group footer 
    but how??? please help me!
    tommy

  17. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 09 Mar 2009 Link to this post

    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.
  18. Julius
    Julius avatar
    8 posts
    Member since:
    Dec 2012

    Posted 10 Apr 2013 Link to this post

    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
  19. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 15 Apr 2013 Link to this post

    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.
  20. Julius
    Julius avatar
    8 posts
    Member since:
    Dec 2012

    Posted 15 Apr 2013 Link to this post

    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
  21. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 19 Apr 2013 Link to this post

    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.
  22. Julius
    Julius avatar
    8 posts
    Member since:
    Dec 2012

    Posted 21 Apr 2013 Link to this post

    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
  23. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 24 Apr 2013 Link to this post

    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.
  24. Julius
    Julius avatar
    8 posts
    Member since:
    Dec 2012

    Posted 25 Apr 2013 Link to this post

    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?
  25. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 26 Apr 2013 Link to this post

    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.
  26. Julius
    Julius avatar
    8 posts
    Member since:
    Dec 2012

    Posted 29 Apr 2013 Link to this post

    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
  27. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 03 May 2013 Link to this post

    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.
  28. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 27 May 2013 Link to this post

    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
  29. Robert
    Robert avatar
    25 posts
    Member since:
    Sep 2010

    Posted 13 Apr Link to this post

    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

     

  30. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 18 Apr Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready