I am creating a page with a RadzenDataGrid, and on each row there is a button to open a dialog to edit the data. On clicking the save button, I call a function to update the record in the database. I can query the database and see that is successfully updates the record, but when the dialog closes and goes back to the main page, it does not update the gridview. I am calling StateHasChanged() and grid.reload() in the dialog close method, but it does not seem to update the screen. If I set a breakpoint and I look at the data object, it does not show the change to the record, but the weird thing is if I click the edit button for that same record again, but text box that has been bound to the record shows the correct data. The only way I have found to make sure it is showing correctly is to reload the data variable with a database call during the close event. If I do that, grid.reload does update the grid. ReloadData is my function to load the data. If I don't call this function, the grid doesn't refresh.
void Close(dynamic result)
{
ReloadData();
grid.Reload();
}
public async Task OpenRequest(int id, string ServerName)
{
await DialogService.OpenAsync<myDialog>(ServerName,
new Dictionary<string, object>() { { "id", id } },
new DialogOptions() { Width = "800px", Height = "600px", Resizable = true, Draggable = true });
}
}