RadzenDataGrid not updating on StateHasChanged

I use Radzen.... a lot... and have run into something I cannot figure out.

I have a RadzenDataGrid which will not update on a StateHasChanged event. If I click on a Column Header (like to sort if for example) it will refresh, or i can call dataGrid.Reload() manually and it works, but I have never had to explicitly do this before.

It is the most basic of data grids, nothing complicated going on, no virtualization etc.

And this only happens on one component, other components do not exhibit this behavior.

I guess my question is, has anyone else ever run into this?

Below is the grid for reference:

<RadzenDataGrid @ref="dataGrid" TItem="ProductItem" Data="Additions" AllowFiltering="true" AllowSorting="true"
                         FilterMode="FilterMode.Simple">
    <Columns>
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.CompanyName)" Title="@nameof(ProductItem.CompanyName)" />
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.Description)" Title="@nameof(ProductItem.Description)" />
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.Quantity)" Title="@nameof(ProductItem.Quantity)" Width="100px" TextAlign="TextAlign.Center" />
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.ExtCost)" Title="@nameof(ProductItem.ExtCost)" Width="125px">
            <Template Context="item">
                @item.ExtCost.ToString("c")
            </Template>
            <FooterTemplate>
                @Additions.Sum(x => x.ExtCost).ToString("c")
            </FooterTemplate>
        </RadzenDataGridColumn>
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.ExtPrice)" Title="@nameof(ProductItem.ExtPrice)" Width="125px">
            <Template Context="item">
                @item.ExtPrice.ToString("c")
            </Template>
            <FooterTemplate>
                @Additions.Sum(x=>x.ExtPrice).ToString("c")
            </FooterTemplate>
        </RadzenDataGridColumn>
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.EffectiveDate)" Title="Eff Date" Width="125px">
            <Template Context="item">
                @item.EffectiveDate.ToShortDateString()
            </Template>
        </RadzenDataGridColumn>
        <RadzenDataGridColumn TItem="ProductItem" Property="@nameof(ProductItem.CancelledDate)" Title="Cancel Date" Width="125px">
            <Template Context="item">
                @item.CancelledDate?.ToShortDateString()
            </Template>
        </RadzenDataGridColumn>
        <RadzenDataGridColumn TItem="ProductItem" Width="40px" Filterable="false" Sortable="false">
            <Template Context="item">
                <RadzenButton Size="ButtonSize.Small" Icon="delete" Click="@(args => RemoveLineItem(item))" />
            </Template>
        </RadzenDataGridColumn>
    </Columns>
</RadzenDataGrid>

The DataGrid will recreate the UI from provided Data when you call Reload() - it’s ok in my opinion to use it.

Thank you enchev. Any idea why it will not refresh on a StateHasChanged?

I'm afraid that without debugging your app I cannot provide any additional info.

Roger that. Thank you for the response.

I have the same problem. If I use RadzenGrid the changes in de collection are detected en the grid refreshes but if I use RadzenDataGrid the changes are not detected.

When i use the debugger after saving the changes the statehaschanged is fired and I can see the changed collection and count but RadzenDataGrid doesn't update.