Your users say which rows come first, and the grid sorts. Several sort keys keep the order the user gives them.
Sort all employees newest hires first
sort startDate descendingSort by department A to Z, then salary highest first, then name A to Z
sort department ascendingsort salary descendingsort name ascendingA follow-up changes only the sort. After "Show only Engineering employees, highest salary first":
Now change only the sort to name A to Z
filter department is Engineeringsort name ascendingWords such as "highest", "top", "latest" and "newest" sort descending; "lowest", "earliest" and "oldest" ascending; alphabetical order is ascending. "Top 3" also selects the first three rows: see Row selection.
| Setting | Where | With MUI's stock resolver | With the Gridsay helper |
|---|---|---|---|
disableColumnSorting | Grid prop | Not sent. Gridsay answers with a sort, the grid does not apply it, and the panel still reports success. | Sent. A question that needs a sort is declined. |
sortable: false | Column | Not sent. The grid applies a sort on that column anyway: MUI allows sorting it from code. | Sent. A sort on that column is declined. |
| Row grouping | Grid | A sort on a grouped column sorts the rows inside each group; the groups keep their order. | The sort moves to the grouping column, so the groups reorder. |
rowGroupingColumnMode | Grid prop | No effect: the groups do not reorder. | In single mode, all group levels share one direction: the first grouped column in the sort decides it. |
To order groups by their totals ("revenue by brand, highest first"), Gridsay sorts by the aggregated column: see Aggregation.
A question that names something no column holds is declined, with a suggestion where the model has one:
show the employees with the best work-life balance
I can't measure work-life balance; try showing the top-rated employees instead.
Your user reads this sentence. The table stays as it was.With the helper, a sort your grid does not allow is declined too. If an answer still uses it after one correction, the sentence is "Sorting is switched off for this table." or, naming the column, The `salary` column can't be sorted.
Sorting by the grid's own controls, such as the selection checkbox, is declined: they are not data.