I’m trying to sort a dataset based on two columns and tried following another post linked here to get the desired outcome, but I wasn’t successful. I was wondering if anyone has any insights/recommendations?
For reference, I wrote the code below as part of my if-else statement. It sorts the table based on one column but doesn’t work when I add the second column:
Thank you!!! Any kind of import to happen before using OrderBy()?
Do I need to install a module?
Assuming we have to import the command? Cause I just cannot find any example or description for it.
I have tried this and it worked. The only issue is that it works only if you have a table with one page once the data gets bigger and the table goes into the 2nd page it won't work for the 2nd page and the pages afterward. Thank you!!
No, you just have to use a binding on a custom property to do the sorting. Then provide that to the table dataset, that way you can do the sorting prior to it being "paged".
I did expression binding on Data Property of the power table and it did not work, but maybe yes I could use your method to do binding on custom property.
In post below it is mentioned that the dataset is the result of a SQL query
Is there a way to sort a dataset on two different columns. The ****data in the dataset is the result of ** a SQL query. Lets say i have a dateset with 10 column**s. I have a column that has a flag that is set for example either UP or Down. Another column has a Sequence number that is unique for the two different types. So in the data I have 10 UPs and 10 Downs for a total of 20 rows. I want to sort first on the Type and get all my UPs, then within each type I want to sort by the sequence number so i end
That is the post she linked and not her post. Just because she linked to a post which references a SQL query doesn’t mean that she is getting her data from a SQL query.
To answer your question directly, if the user has the ability to change the sort order then for relatively small data sets it will be more performant to do the sort in the front end. As the dataset grows in size that will shift to the back end.
There is really no reason here to suggest one way or the other, and since the OP was already doing the sort on the front end the suggested solution was also front end based.