Skip to content

DataGrid Reload() lags one Render behind #2214

Open
@Anspitzen

Description

@Anspitzen

Describe the bug
When calling RadzenDataGrid.Reload() the rendering does only render the state from calling Render before

To Reproduce
Steps to reproduce the behavior:

  1. Go to Official Demo page
  2. For easier reading replace code with:
    <RadzenNumeric @bind-Value=idValue />
        <RadzenDataGrid @ref="grid" Data=@employees FilterMode="FilterMode.Simple" AllowFiltering="true">
        <Columns>
            <RadzenDataGridColumn Property="ID" Title="ID" FilterValue="@idValue" />
            <RadzenDataGridColumn Title="Customer" Property="CompanyName" Type="typeof(IEnumerable<string>)" />
        </Columns>
    </RadzenDataGrid>
<EventConsole @ref=@console />

@code {
    EventConsole console;

    RadzenDataGrid<Employee> grid;
        int? i;
    int? idValue {get{return i;}
set{
i = value; 
console.Log(value); 
grid.Reload();
}}
    
    List<string> companyNames = new List<string> {"Vins et alcools Chevalier", "Toms Spezialitäten", "Hanari Carnes", "Richter Supermarkt", "Wellington Importadora", "Centro comercial Moctezuma" };

    public class Employee
    {
        public int ID { get; set; }
        public string CompanyName { get; set; }
    }
    IEnumerable<Employee> employees; 

    protected override async Task OnInitializedAsync()
    {
        employees = await Task.FromResult(Enumerable.Range(0, 10).Select(i =>
            new Employee
            {
                ID = i,
                CompanyName = i < 4 ? companyNames[0] : companyNames[i - 4],
            }).AsQueryable());
    }
}
  1. Change value in filed above grid
  2. See value changing in filter field, but list not updating
  3. Change value again in field above
  4. See now the list updating to filtering with value from before

Expected behavior
Rendering does work instant and does not lag one render cycle behind.

Screenshots
Image

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome

Additional Information
Putting in the value into the grid internal filter field does filter and refresh instant, but not reflect it back to the one field bound outside
Triggering a render of grid list by sorting does also use the parameters then. (Calls the same internal reload)
Calling StateHasChanged after/before the Reload does nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions