[PR #185] [CLOSED] Support custom filtering #2054

Open
opened 2026-01-29 18:16:55 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/185
Author: @viordash
Created: 7/27/2021
Status: Closed

Base: masterHead: ServerSideFiltering


📝 Commits (10+)

  • 8347185 skip data operations in View getter when loading data on server side
  • 0f6258f WIP. add feature to support custom filtering in DataGrid
  • dcfb673 change columns type in ApplyDataCustomFiltering
  • e07b7b7 support for custom filtering on the client side using the CustomFiltering func in the DataGridColumn
  • 6fe74fc minor refactoring of DataGrid tests
  • 5f6427a Merge branch 'master' into ServerSideFiltering
  • 85b75ed certain IEnumerable.Where for custom filtering in RadzenDataGrid.View, for fix InvalidOperationException when grid bound to EF DbSet
  • 963f7bb change CustomFilteringArgs to access column filter parameters
  • d9c80d7 test to check the CustomFiltering arguments are filled
  • 685616b Merge branch 'master' into ServerSideFiltering

📊 Changes

4 files changed (+190 additions, -25 deletions)

View changed files

📝 Radzen.Blazor.Tests/DataGridTests.cs (+117 -0)
📝 Radzen.Blazor/Common.cs (+12 -1)
📝 Radzen.Blazor/RadzenDataGrid.razor (+58 -24)
📝 Radzen.Blazor/RadzenDataGridColumn.razor (+3 -0)

📄 Description

This PR adds following:

  • ability to filter data with custom rules by assigning the RadzenDataGridColumn.CustomFiltering function in Client-side mode.
  • disabling unnecessary filtering/sorting operations in RadzenDataGrid.View in Server-side mode.
  • added related tests,
    • DataGrid_View_Use_ClientSide_Filtering_When_LoadData_Empty
    • DataGrid_View_Use_ServerSide_Filtering_When_LoadData_Used
    • DataGrid_View_Use_Custom_Filtering

RadzenDataGridColumn custom filtering:

    [Parameter]
    public Func<CustomFilteringArgs<TItem>, bool> CustomFiltering { get; set; } = null;
    public class CustomFilteringArgs<T>
    {
        public Blazor.RadzenDataGridColumn<T> Column { get; internal set; }
        public T Data { get; internal set; }
    }

Trigger to this PR was the System.Linq.Dynamic.Core.Exceptions.ParseException that was thrown when trying to use RadzenDataGrid.View in event LoadData and active filter FilterOperator.Contains in a column with composite data, for example, an array of objects with fields [int Id], [string Name]


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/185 **Author:** [@viordash](https://github.com/viordash) **Created:** 7/27/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ServerSideFiltering` --- ### 📝 Commits (10+) - [`8347185`](https://github.com/radzenhq/radzen-blazor/commit/8347185a12693b22bfc72b995087df0bcabe1e4b) skip data operations in View getter when loading data on server side - [`0f6258f`](https://github.com/radzenhq/radzen-blazor/commit/0f6258f427684e607347aaa76bd552972343d370) WIP. add feature to support custom filtering in DataGrid - [`dcfb673`](https://github.com/radzenhq/radzen-blazor/commit/dcfb67340c6474f1430b0e7e75274005b0c15ed7) change columns type in ApplyDataCustomFiltering - [`e07b7b7`](https://github.com/radzenhq/radzen-blazor/commit/e07b7b7b555e31aaf13239610daeb7c5ec63eaea) support for custom filtering on the client side using the CustomFiltering func in the DataGridColumn - [`6fe74fc`](https://github.com/radzenhq/radzen-blazor/commit/6fe74fc3a43d8c4bf4eb544d3f4e62af55a614f6) minor refactoring of DataGrid tests - [`5f6427a`](https://github.com/radzenhq/radzen-blazor/commit/5f6427aaa548a7757299f921436e4c49e28ad1a1) Merge branch 'master' into ServerSideFiltering - [`85b75ed`](https://github.com/radzenhq/radzen-blazor/commit/85b75ede5536a606c54efc1df847f94c1fdb12a6) certain IEnumerable.Where for custom filtering in RadzenDataGrid.View, for fix InvalidOperationException when grid bound to EF DbSet - [`963f7bb`](https://github.com/radzenhq/radzen-blazor/commit/963f7bbb1e285b9889b005b164f4c86380e54b45) change CustomFilteringArgs to access column filter parameters - [`d9c80d7`](https://github.com/radzenhq/radzen-blazor/commit/d9c80d71eb0df9e4303c0d012ebba9b9fa25c9e6) test to check the CustomFiltering arguments are filled - [`685616b`](https://github.com/radzenhq/radzen-blazor/commit/685616be8a6a53ecaedac5bce06b3ddc8cf2ce80) Merge branch 'master' into ServerSideFiltering ### 📊 Changes **4 files changed** (+190 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor.Tests/DataGridTests.cs` (+117 -0) 📝 `Radzen.Blazor/Common.cs` (+12 -1) 📝 `Radzen.Blazor/RadzenDataGrid.razor` (+58 -24) 📝 `Radzen.Blazor/RadzenDataGridColumn.razor` (+3 -0) </details> ### 📄 Description This PR adds following: - ability to filter data with custom rules by assigning the RadzenDataGridColumn.CustomFiltering function in Client-side mode. - disabling unnecessary filtering/sorting operations in RadzenDataGrid.View in Server-side mode. - added related tests, - DataGrid_View_Use_ClientSide_Filtering_When_LoadData_Empty - DataGrid_View_Use_ServerSide_Filtering_When_LoadData_Used - DataGrid_View_Use_Custom_Filtering RadzenDataGridColumn custom filtering: ```cs [Parameter] public Func<CustomFilteringArgs<TItem>, bool> CustomFiltering { get; set; } = null; ``` ```cs public class CustomFilteringArgs<T> { public Blazor.RadzenDataGridColumn<T> Column { get; internal set; } public T Data { get; internal set; } } ``` Trigger to this PR was the System.Linq.Dynamic.Core.Exceptions.ParseException that was thrown when trying to use RadzenDataGrid.View in event LoadData and active filter FilterOperator.Contains in a column with composite data, for example, an array of objects with fields [int Id], [string Name] --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 18:16:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2054