Hello I have a DataGrid with a column that has a custom header. This header is a Select. What I want to do is every time the user selects an option the column should be sorted desc. The renderHeader looks like this
renderHeader: (params) => {
return <CategoryPickerHeader value={category} handleChange={setCategory} />;
},
I know the DataGrid api has a couple methods for sorting (https://v4.mui.com/api/data-grid/grid-api/#main-content) sortColumn() & applySorting()
But I haven't found any example of how to use those api methods.
Can someone provide an example or knows how to use the DataGrid api?
Thanks in advance!