-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MudDataGrid: Add AllowUnsorted property #11443
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
MudDataGrid: Add AllowUnsorted property #11443
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #11443 +/- ##
=======================================
Coverage 91.13% 91.13%
=======================================
Files 466 466
Lines 14417 14418 +1
Branches 2792 2792
=======================================
+ Hits 13139 13140 +1
Misses 641 641
Partials 637 637 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting flagged in the build and add unit tests.
All good otherwise.
Added unit test and fixed formatting |
Since you are in there should change the AllowSorting in HeaderCell.razor.cs to this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have the test check both states of the new property
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's been approved twice and already exists in MudTableBase it seems like a reasonable addition to me
Why did we set the default to AllowUnsorted=true since that is a breaking change? |
You can make a quick new PR to fix that. |
I will do so. Feel free to close it if ya'll decide to leave it in. |
Description
This PR adds the AllowUnsorted property from MudTable to force the user to sort between Ascending and Descending without the None state.
How Has This Been Tested?
Unit test
Created a unit test with a new MudDataGrid with AllowUnsorted="false" setting the sort direction to Asc -> Desc -> Asc
Visually
before:

after:

Type of Changes
Checklist
dev
).