Skip to content
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

Checkboxes reset on StateHasChanged #337

Closed
twisted89 opened this issue Feb 17, 2022 · 2 comments
Closed

Checkboxes reset on StateHasChanged #337

twisted89 opened this issue Feb 17, 2022 · 2 comments

Comments

@twisted89
Copy link

There seems to be conflicting information on how to handle the checkbox column on state changes.

Your documentation says to use "shouldRender", which prevents the checkboxes from resetting but completely breaks updating information on the rest of the page. Not really a solution.

In the report here #178
You say there's no need to use "shouldRender" and it should work fine, but it doesn't.

Subscribing to RowCheckboxChanged and calling StateHasChanged(); allows my fields to update but all of the column checkboxes reset to unchecked.

I've tried using solutions suggested elsewhere such as Task.Yield() to no success. Can you please look into this and provide a working solution that doesn't break field updates outside of the grid?

@gustavnavar
Copy link
Owner

I think GridBlazor 3.2.9 will fix this issue

@gustavnavar
Copy link
Owner

In version GridBlazor 3.2.10, the ExceptCheckedRows dictionary is only initialized when the GridComponent object is created. In previous versions it was initialized when the OnParametersSet was executed (when the component was initialized and when the parent component was re-rendered).

The initialization of this dictionary caused that all checkboxes where reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants