RadzenGrid: LoadData event

Hi, I am getting this error.

System.InvalidOperationException: 'The current thread is not associated with the renderer's synchronization context. Use Invoke() or InvokeAsync() to switch execution to the renderer's synchronization context when triggering rendering or modifying any state accessed during rendering.

Bug found.
public async void Reload()
{
await Task.Run(() => LoadData.InvokeAsync(new LoadDataArgs
{
Skip = skip,
Top = PageSize,
OrderBy = orderBy,
Filter = oDataWhere
}));
if (!LoadData.get_HasDelegate())
{
await this.Invoke((Action)delegate
{
this.StateHasChanged();
});
}
}

How the grid is bound in your case? Are you assigning Data directly? You can check our demos for more info: https://blazor.radzen.com/datagrid

Hi Vladimir,
I checked your demo. I am not loading all the records at OnInit(). I want load data per page. How can i use LoadData event.

You can call ToList() of the query which will load all data and you can again assign Data for the grid.