Completed
Last Updated: 10 Apr 2020 09:08 by ADMIN
Nick
Created on: 03 Jun 2019 18:06
Category: Grid
Type: Feature Request
18
Ability to set the sorted columns programatically
It would be useful to be able to set the sorting of the grid programmatically.

In my particular scenario we have an existing system which is very flexible and has user created entities. We already have the idea of "view definitions" which are used to define how a list of entities (for example companies or contacts) is displayed in a grid format. This view definition contains our own version of sort descriptors to tell us what the initial sorting should be.

I am getting the data using our existing API in the ReadItems method. Because I already have the view definition I can pass our sort descriptor to our API and it returns the data pre-sorted (it also handles paging). I would then like to be able to tell the grid which columns I have sorted by so it could be represented in the UI with the arrow. The grid doesn't actually have to sort the data.

Here is a more detailed description of the case: https://www.telerik.com/forums/grid-questions-07d1fe846889#RgZmmE2avUaSOsIcprdOMg.


2 comments
ADMIN
Marin Bratanov
Posted on: 10 Apr 2020 09:08

Hi all,

This is possible through the grid state as of 2.9.0: https://docs.telerik.com/blazor-ui/components/grid/sorting#sort-from-code

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
ADMIN
Marin Bratanov
Posted on: 04 Jun 2019 05:55
Hi Nick,

I separated the multi column sorting as a separate request, because both may not get implemented at the same time: https://feedback.telerik.com/blazor/1411730-multi-column-sorting. I also took the liberty of adding a link to the forum thread with the more detailed code snippet as a reference.

If you have suggestions on how you would prefer to control the sorting state of the columns, please share it here as well.

I must also clarify that when OnRead is used this setting should only add the arrows in the column headers, but it should produce actual sorting of the data otherwise.


Regards,
Marin Bratanov
Progress Telerik UI for Blazor