Skip to content

MudDataGrid: Custom comparer#10156

Merged
ScarletKuro merged 14 commits intoMudBlazor:devfrom
Anu6is:add-selection-comparer
Nov 2, 2024
Merged

MudDataGrid: Custom comparer#10156
ScarletKuro merged 14 commits intoMudBlazor:devfrom
Anu6is:add-selection-comparer

Conversation

@Anu6is
Copy link
Contributor

@Anu6is Anu6is commented Nov 1, 2024

Description

Adds a Comparer property to MudDataGrid and update selection methods

  • Add Comparer property of type IEqualityComparer<T> to MudDataGrid
  • Update SetSelectedItemAsync and SetSelectAllAsync methods to use Comparer for row selection
  • Update Selected property in CellContext to use Comparer for checking if a cell is selected

Resolves #10139

How Has This Been Tested?

Unit test created and test viewer component added

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

Anu6is added 12 commits October 30, 2024 10:15
…n methods

* Add `SelectionComparer` property of type `IEqualityComparer<T>` to `MudDataGrid`
* Update `SetSelectedItemAsync` and `SetSelectAllAsync` methods to use `SelectionComparer` for row selection
* Update `Selected` property in `CellContext` to use `SelectionComparer` for checking if a cell is selected
@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Nov 1, 2024
@codecov
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.23%. Comparing base (83de262) to head (bf7ff5f).
Report is 10 commits behind head on dev.

Files with missing lines Patch % Lines
...MudBlazor/Components/DataGrid/MudDataGrid.razor.cs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10156   +/-   ##
=======================================
  Coverage   91.22%   91.23%           
=======================================
  Files         411      411           
  Lines       12484    12496   +12     
  Branches     2434     2435    +1     
=======================================
+ Hits        11389    11401   +12     
  Misses        552      552           
  Partials      543      543           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro
Copy link
Member

LGTM. I will do some manual testing later and merge it.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 2, 2024

@ScarletKuro ScarletKuro merged commit 86745c1 into MudBlazor:dev Nov 2, 2024
@ScarletKuro
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a configurable property in MudDataGrid to determine row selection based on a custom value instead of object equality

2 participants