Radzen Detail Hierarchy Master Detail Grid

Hi,

I would like to know how is it possible to reflect changes made to data in grid for other users without reloading or refreshing data grid ?

I have a grid which shows product and details in Hierarchy. Now assume User A updates product A quantity how can that change be reflected for User B on the same page without reloading or refreshing grid because I don't want the datagrid to collapse for User B on every change made by other users.

I just want to show live changes on data to all users. I am using SignalR to send and receive updates but I am struggling to find a way to update grid.

Below is my hubConnection where I get notification when user modifies rows and submit on form.

  • rowId refers to unique guid of Product.
  • ProductListModel is a List
  1. Below is my try number 1 by updating row rather then updating grid. This doesn't work and don't show update for other user (in second browser tab)
hubConnection.On<string, string>("RowUnlocked", async (rowId, module) =>
{
    // Ensure the grid update is executed on the UI thread using InvokeAsync
    await InvokeAsync(async () =>
    {
        var productToUpdate = ProductListModel.FirstOrDefault(x => x.Product_ID.ToString() == rowId);
        if (productToUpdate != null)
        {
            await ProductDataGrid.UpdateRow(productToUpdate);
        }
    });
});
  1. Below is my try number 2 which works but collapses the datagrid for other user (second tab):
hubConnection.On<string, string>("RowUnlocked", async (rowId, module) =>
{
    await InvokeAsync(StateHasChanged);
});

The only way except already mentioned is to bind to EF DbQuery where there is a change tracking by default.

I am not using EF and manually managing data insertions and updates.

As already mentioned I’m not aware of any other approach.

But my question is more about Radzen component rather than SignalR itself.

I want to know is there a way in Radzen to refresh specific row or specific cell value in datagrid instead of relaoding or refreshing page ?

No, there is no other way except already mentioned.

Thank you and I would like to request a feature, if possible to have something like below:
https://demos.devexpress.com/ASPNetCore/Demo/DataGrid/RealTimeUpdates/

Real time update can be implemented even now if you call Reload() for the DataGrid on timer interval.

It doesn't do the trick for all the browser tabs using SignalR.

I have tried when I only do Grid.Reload() I get below error when I click on row :

System.InvalidOperationException: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.

When I try with below code:

// InvokeAsync is inherited, it syncs the call back to the render thread
await InvokeAsync(() =>
{
   ProductDataGrid.Reload();
});

The grid does not update without page refresh for other tabs of the browser. I know you can't help with this detail and I am struggling to make it to work. I am trying to reflect change on all browsers\tabs using SignalR without reloading page without EF. But I will share my findings if I get it to work. Thank you

This has nothing to do with our component. Check this thread, exactly the same can be achieved for the DataGrid: