Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vernou
Copy link
Member

@vernou vernou commented Aug 24, 2025

Fix #11758

Currently, when MudDataGrid.Items is set with a observable collection and the collection is modified, the change isn't rendered.

This PR fix it. When the collection is modified, StateHasChanged is called to refresh the UI.

Moreover, I move the callback of INotifyCollectionChanged.CollectionChanged in InvokeAsync, because the collection can be changed in a other thread (like in bug issue #11758 where the collection is modified in a trigger).

Checklist:

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

@vernou vernou self-assigned this Aug 24, 2025
@vernou vernou added the bug Unexpected behavior or functionality not working as intended label Aug 24, 2025
@vernou vernou marked this pull request as ready for review August 24, 2025 16:54
@vernou vernou requested a review from versile2 August 24, 2025 16:54
Copy link
Contributor

@versile2 versile2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. I've examined the tests, verified the test fails before the fix and the fix resolves the test case.

V

@vernou vernou requested a review from ScarletKuro August 25, 2025 14:02
@ScarletKuro ScarletKuro merged commit 09c6376 into MudBlazor:dev Aug 25, 2025
6 checks passed
This was referenced Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior or functionality not working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MudDataGrid: No refresh of the DataGrid after a CollectionChanged (of an ObservableCollection)
3 participants