Using ag-Grid with React: Rows

Multi-Column Sorting

It is possible to sort by multiple columns. The default action for multiple column sorting is for the user to hold down Shift while clicking the column header. To change the default action to use the Ctrl key (or Cmd key on Apple) instead, set the property multiSortKey='ctrl'.

As usual, we'll do this both as a piece of state:

// App.js
// this.state
multiSortKey: "ctrl",

And as a prop:

// App.js
// AgGridReact component props

Now to select multiple sorting options, we can use Ctrl (Windows) or Cmd (Mac) instead of Shift.