PagedDataBoundComponent.Reload

Digging around the RadzenGrid, and it appears that PagedDataBoundComponent.Reload is async void which is a big no-no for asynchronous programming in .NET:

https://www.infoworld.com/article/3126293/best-practices-in-net-asynchronous-programming.html#:~:text=Avoid%20having%20void%20return%20type%20in%20async%20methods&text=The%20await%20keyword%20is%20used,a%20suspension%20and%20resumption%20point.

Also, there appears to be a LoadData event callback for when data starts to load but there doesn't appear to be a callback when the data is loaded. Is there a suggested way to do this?

For reference, I am wanting to provide a clear visual indicator that the backing query is being recalculated in the case there are any delays, thereby improving user experience.

Thank you for any assistance you can provide.

You are right, we will change it to Task! The LoadData event is actually how Radzen DataGrid will ask you to provide data - since the developer is responsible for providing the data the end of the process is known.

1 Like

Ah! Yes of course, I see this now:

https://blazor.radzen.com/datagrid-loaddata

I think what I was looking for was for events native to RadzenGrid when it is handling the data updates. For instance, in your "plain vanilla" example (https://blazor.radzen.com/datagrid) it makes use of a dbContext. That's exactly what I am using, but the query might take a while and want to update the interface accordingly. It would be nice to have an Updating and Updated events on this control, if possible, so one can update any interface elements to let the user know work is being done.

In any case, I can use the LoadData callback as you state in the meantime for my scenario.

Thank you for your quick and informative reply!