Groupping and sorting in kendo Grid

7 posts, 0 answers
  1. Safa
    Safa avatar
    3 posts
    Member since:
    May 2015

    Posted 06 May Link to this post

    Hello,

    I'm currently working on a kendo grid where sorting and groupping are enabled.

    when I sort the grid depending on one or more columns, the grid is sorted as expected, however if I choose to group the grid according to any column afterwards, the sorting gets cancelled.

    I understand that this has been an issue raised before since kendo didn't support it. but is it still the case?

    Is there a workaround for this?

     

     

     

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 10 May Link to this post

    Hello Safa,

    There are two types of sort:

    - When you group and click on the column header sorting is applied over the items inside the group. If you need to sort the groups, i.e group headers, you should click over the group item above grid header. When grouping is applied through the UI default sort order of the group is ascending. However if there is sort applied over other fields, their sort order will be preserved within the group.

    - When there isn't grouping applied - sorting is applied over the whole set of data item.

    Maybe this is where confusion comes from.

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Safa
    Safa avatar
    3 posts
    Member since:
    May 2015

    Posted 02 Jun Link to this post

    Hello Nikolay,

    thanks for your reply.

    I will try to explain my problem a bit more. I'm speaking about the  case when I have:

    1) populated the grid

    2) applied sorting using column headers therefore the current data displayed will be sorted

    3) finally i have applied groupping

    my problem is that my sorting preferences at this point will be lost.

     

     

  5. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    119 posts

    Posted 06 Jun Link to this post

    Hello Safa,

    The Kendo UI Grid preserves the sort order after grouping. If we take for example the Kendo UI Grid demo below, sort by name and then group by country, the names will remain sorted:

    http://dojo.telerik.com/EwonI

    Please try to recreate the issue using this example, so I can investigate the cause and make suggestions.

    Meanwhile, if you have any further questions regarding the grouping and sorting functionality of the Kendo UI Grid, I will be pleased to assist.

    Kind Regards,
    Alex
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Igor
    Igor avatar
    11 posts
    Member since:
    Sep 2016

    Posted 25 Oct in reply to Nikolay Rusev Link to this post

    Hi Nikolay,

    How can I sort rows within of group by invisible filed (e.g., id). Please find my example http://jsfiddle.net/iakhmedov1/T64Kb/93/

    Thanks,

    Igor

  7. Igor
    Igor avatar
    11 posts
    Member since:
    Sep 2016

    Posted 25 Oct in reply to Nikolay Rusev Link to this post

    Hello Nikolay,

     

    How can I sort rows within of group by invisible filed? Please look at my example: http://jsfiddle.net/iakhmedov1/T64Kb/93

     

    Thanks,

    Igor

  8. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 27 Oct Link to this post

    Hello Igor,

    You cannot really sort on invisible field. However you can set one property for as a field of the column and show another in the column template.

    See the example bellow for more details - sorting on first column will actually sort over the `id` field while still showing the `city` as content.

    http://dojo.telerik.com/@rusev/OpaWa

    Regards,
    Nikolay Rusev
    Telerik by Progress
     
    Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
     
Back to Top
Kendo UI is VS 2017 Ready