-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Add remove sort capability #1826
Conversation
We can have a method to "remove" the sort order, but :
|
I'll look into the a11y piece. Good point.
It is fairly common to have a way to "unsort" a column in a DataGrid (MudBlazor, Radzen and DevExpress have it too) |
Update DataGrid a11y docs
How about click for the 3rd time to remove the sort? |
No. that is not an option currently. Internally the button just looks at a boolean sortByAscending variable. Would need a lot more additional coding. |
I see, that could introduce a lot of work and chaos... How about have another button, like the filter button to remove the sort? |
* Add remove sort for datagrid * Undo remove sort method returning bool * A11y fixes: add keydown handler to remove column sort * Update WhatsNew Update DataGrid a11y docs
Previosly when a sort was executed on a DataGrid, (by clicking on a column header button or pressing enter when the column header button is focused), there was no option to undo that.
With this PR it is now possible to right click on the sorted colum header button to clear the sort and restore it to the default/start situation. updated: or use Ctrl+Enter to remove the sorting when the column header button is focused
When a grid has not sort specified, it just goes back to its initial state. When thare was a defaut sort specified, it will be restored:
Based on discussion in #283