sorting on cell value

2 posts, 0 answers
  1. tom
    tom avatar
    1 posts
    Member since:
    Jan 2021

    Posted 07 Jan Link to this post

    Hi,

    I have a grid where column A takes the size of an array and, depending on if the status in column B is right, outputs the array's length. If the status is not right, the output is a -. When I sort, the underlying value from the field is sorted, whereas I want the cell's value to be sorted. The column may look like this:

    5

    3

    -

    6

    -

    4

    and I would want it to sort to 

    6

    5

    4

    3

    -

    -

     

    Currently it sorts to because the underlying value of the - is 6 and 4

    6

    -

    5

    4

    -

    3

     

    Is there any way to sort by the cell and not the field? 

  2. Stefan
    Admin
    Stefan avatar
    3008 posts

    Posted 08 Jan Link to this post

    Hello, Tom,

    There are some options in this case as the sorting is done outside of the Grid:

    1) Process the data and create a new field that will hold values that will be the same as the display values. Then when sorting, instead of sorting by the column A value, sort by that field. The issue with that approach is that the visual indication will be missing.

    2) The sorting logic can be modified once this feature is available:

    https://github.com/telerik/kendo-react/issues/819

    3) Use custom sorting on the client or on the server that will sort the data based on the application requirement.

    Regards,
    Stefan
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top