DataGrid not recognizing changes made to associated data #279

Closed
opened 2026-01-29 17:34:38 +00:00 by claunia · 2 comments
Owner

Originally created by @jcasement on GitHub (Dec 8, 2021).

@akorchev When working with the RadzenDataGrid and the CellRender to change the background-color I came across a small issue.
The DataGrid did not recognize the change to the style after the underlying data had changed.
The way I'm coming at this is to trigger a refresh to the underlying data from a Timer every minute.
When the Timer completes, the code compares the previous data to the newly gotten data and uses the CellRender to change the background-color based upon data status changes.
The timer has the "StateHasChanged" which I thought would have caused the DataGrid to refresh but it doesn't.
I can see the CellRender has done its work since when I start to use the DataGrid sorting functionality the background-color appears.
Maybe there is some other way to force the DataGrid to re-render.

Originally created by @jcasement on GitHub (Dec 8, 2021). @akorchev When working with the RadzenDataGrid and the CellRender to change the background-color I came across a small issue. The DataGrid did not recognize the change to the style after the underlying data had changed. The way I'm coming at this is to trigger a refresh to the underlying data from a Timer every minute. When the Timer completes, the code compares the previous data to the newly gotten data and uses the CellRender to change the background-color based upon data status changes. The timer has the "StateHasChanged" which I thought would have caused the DataGrid to refresh but it doesn't. I can see the CellRender has done its work since when I start to use the DataGrid sorting functionality the background-color appears. Maybe there is some other way to force the DataGrid to re-render.
Author
Owner

@akorchev commented on GitHub (Dec 9, 2021):

Try calling the Reload method of the DataGrid. Also please follow the issue template.

@akorchev commented on GitHub (Dec 9, 2021): Try calling the Reload method of the DataGrid. Also please follow the issue template.
Author
Owner

@jcasement commented on GitHub (Dec 9, 2021):

Many thanks

@jcasement commented on GitHub (Dec 9, 2021): Many thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#279