DataGrid numerical column filter applies inconsistently #1878

Closed
opened 2026-01-29 17:59:42 +00:00 by claunia · 3 comments
Owner

Originally created by @uflowie on GitHub (Oct 6, 2025).

Describe the bug
When setting a filter on a numerical column in a datagrid, the filter exhibits the following incorrect behaviors:

  1. On losing focus, the filter will apply partially before the "Apply" button has been pressed
  2. If at least one row in the filtered column satisfies the filter, then
    1. The displayed rows do not change
    2. The pager disappears if the amount of elements that satisfy the filter is smaller than the page size
    3. Any properties using the "View" property of the grid will update according to the elements that satisfy the filter
  3. If no rows in the filtered column satisfy the filter, the filter applies fully

Filters on other columns do not seem to exhibit these behaviors (tested with string and Date). Filters in those columns have no effect before the "Apply" button has been pressed

To Reproduce

  1. Go to https://blazor.radzen.com/datagrid-footer-totals?theme=material3
  2. Click on the "Order ID" filter
  3. Enter the Order ID of the first row (10248 in my case) as an "Equals" filter
  4. Unfocus the Input field

Expected behavior

  1. Rows do not change
  2. "Displayed Orders" reads "144 out of 144"
  3. The pager element stays

Observed behavior

  1. Rows do not change
  2. "Displayed Orders" reads "1 out of 144"
  3. The pager element disappears

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Version: Latest
Originally created by @uflowie on GitHub (Oct 6, 2025). **Describe the bug** When setting a filter on a numerical column in a datagrid, the filter exhibits the following incorrect behaviors: 1) On losing focus, the filter will apply partially before the "Apply" button has been pressed 2) If at least one row in the filtered column satisfies the filter, then 1) The displayed rows do not change 2) The pager disappears if the amount of elements that satisfy the filter is smaller than the page size 3) Any properties using the "View" property of the grid will update according to the elements that satisfy the filter 3) If no rows in the filtered column satisfy the filter, the filter applies fully Filters on other columns do not seem to exhibit these behaviors (tested with string and Date). Filters in those columns have no effect before the "Apply" button has been pressed **To Reproduce** 1. Go to https://blazor.radzen.com/datagrid-footer-totals?theme=material3 2. Click on the "Order ID" filter 3. Enter the Order ID of the first row (10248 in my case) as an "Equals" filter 4. Unfocus the Input field **Expected behavior** 1. Rows do not change 2. "Displayed Orders" reads "144 out of 144" 3. The pager element stays **Observed behavior** 1. Rows do not change 2. "Displayed Orders" reads "1 out of 144" 3. The pager element disappears **Screenshots** <img width="2446" height="486" alt="Image" src="https://github.com/user-attachments/assets/6d40bfc9-2560-4195-a854-724633e1eea1" /> **Desktop (please complete the following information):** - OS: Windows 11 - Browser: Chrome - Version: Latest
Author
Owner

@enchev commented on GitHub (Oct 7, 2025):

The problem is with this particular demo since View is accessed twice in the demo templates which will cause immediate filter when Count() is retrieved.

@enchev commented on GitHub (Oct 7, 2025): The problem is with this particular demo since View is accessed twice in the demo templates which will cause immediate filter when Count() is retrieved.
Author
Owner

@uflowie commented on GitHub (Oct 17, 2025):

Hey, I have created a minimal reproduction of this issue: https://github.com/uflowie/RadzenDataGridFilterIssue. The View is only accessed once and it is not running in the demo templates. The problem still occurs.

@uflowie commented on GitHub (Oct 17, 2025): Hey, I have created a minimal reproduction of this issue: https://github.com/uflowie/RadzenDataGridFilterIssue. The View is only accessed once and it is not running in the demo templates. The problem still occurs.
Author
Owner

@enchev commented on GitHub (Oct 22, 2025):

Hey, the View is accessed in the column FooterTemplate which is causing the problematic behavior. Here is how to update the code to avoid this - I'll correct our demo:

@page "/"

@using System.Linq.Dynamic.Core
<ol>
    <li>Click Id Filter</li>
    <li>Enter 1 into the Filter input</li>
    <li>Click out of the Filter input</li>
    <li>"Displayed Employees" now displays 1, even though we can still see all 3 employees ❌</li>
    <li>Clear Id Filter</li>
    <li>Click Name Filter</li>
    <li>Enter asd into the Filter input</li>
    <li>Click out of the Filter input</li>
    <li>"Displayed Employees" displays 3 ✅</li>
</ol>

<RadzenDataGrid Data="_employees" TItem="Employee" @ref="_grid" AllowFiltering>
    <Columns>
        <RadzenDataGridColumn Property="Id" Title="ID">
            <FooterTemplate>
                Displayed Employees: @_employees.AsQueryable().Where(_grid.Query.Filter).Count()
            </FooterTemplate>
         </RadzenDataGridColumn>
        <RadzenDataGridColumn Property="Name" Title="Name"/>
        <RadzenDataGridColumn Property="Age" Title="Age"/>
    </Columns>
</RadzenDataGrid>

@code {
    RadzenDataGrid<Employee> _grid;

    List<Employee> _employees = [
        new Employee { Id = 1, Name = "John Doe", Age = 1 },
        new Employee { Id = 2, Name = "Jane Smith", Age = 2 },
        new Employee { Id = 3, Name = "Sam Brown", Age = 3 }
    ];
}
@enchev commented on GitHub (Oct 22, 2025): Hey, the View is accessed in the column FooterTemplate which is causing the problematic behavior. Here is how to update the code to avoid this - I'll correct our demo: ``` @page "/" @using System.Linq.Dynamic.Core <ol> <li>Click Id Filter</li> <li>Enter 1 into the Filter input</li> <li>Click out of the Filter input</li> <li>"Displayed Employees" now displays 1, even though we can still see all 3 employees ❌</li> <li>Clear Id Filter</li> <li>Click Name Filter</li> <li>Enter asd into the Filter input</li> <li>Click out of the Filter input</li> <li>"Displayed Employees" displays 3 ✅</li> </ol> <RadzenDataGrid Data="_employees" TItem="Employee" @ref="_grid" AllowFiltering> <Columns> <RadzenDataGridColumn Property="Id" Title="ID"> <FooterTemplate> Displayed Employees: @_employees.AsQueryable().Where(_grid.Query.Filter).Count() </FooterTemplate> </RadzenDataGridColumn> <RadzenDataGridColumn Property="Name" Title="Name"/> <RadzenDataGridColumn Property="Age" Title="Age"/> </Columns> </RadzenDataGrid> @code { RadzenDataGrid<Employee> _grid; List<Employee> _employees = [ new Employee { Id = 1, Name = "John Doe", Age = 1 }, new Employee { Id = 2, Name = "Jane Smith", Age = 2 }, new Employee { Id = 3, Name = "Sam Brown", Age = 3 } ]; } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1878