Update through ObservableCollection question

I am using a grid with an ObservableCollection as the datasource so that I can update the visual status of the grid data programmatically. In the Created event for the Grid I am accessing Blazor local storage for items to update the grid data. The problem is that the visual updates to the grid are not happening unless I force a redraw of the grid by changing the filtering or some other action, such as editing another row. I tried calling CallStateHasChangedAsync and CallStateHasChanged on the grid, but that is not refreshing the grid.

I am using the sample code in the documentation where my objects in the ObservableCollection implement INotifyPropertyChanged.

Update: I did a closer inspection of the sample code and noticed that I needed to call InvokeAsync(StateHasChanged) after updating any data. I'm getting the behavior I need now.

1 Reply

JP Jeevakanth Palaniappan Syncfusion Team November 9, 2020 12:53 PM UTC

Hi Jim, 

Greetings from Syncfusion support. 

We are glad to know that you have achieved your expected behavior. Please get back to us if you need further assistance. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon