[PR #2233] [MERGED] feature: DataGrid Columns allow Sort and Filter when bound to Array<o… #3145

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

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/2233
Author: @EdJohnstonG9
Created: 7/23/2025
Status: Merged
Merged: 8/12/2025
Merged by: @enchev

Base: masterHead: master


📝 Commits (10+)

  • dc51503 feature: DataGrid Columns allow Sort and Filter when bound to Array
## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/2233 **Author:** [@EdJohnstonG9](https://github.com/EdJohnstonG9) **Created:** 7/23/2025 **Status:** ✅ Merged **Merged:** 8/12/2025 **Merged by:** [@enchev](https://github.com/enchev) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`dc51503`](https://github.com/radzenhq/radzen-blazor/commit/dc515037a3faaa5fa1ceffae577546143fc319e5) feature: DataGrid Columns allow Sort and Filter when bound to Array<object>[] i.e. DataRow.ItemArray[n] - [`23d0e2b`](https://github.com/radzenhq/radzen-blazor/commit/23d0e2b612ee7ef21a53a392d8724230aed76414) Expose Test page and fix AmbiguousMatch in test (ItemArray not Item) - [`5b1ed82`](https://github.com/radzenhq/radzen-blazor/commit/5b1ed820717f52f807eeb0ac2fb908f7ae3fa2b9) Working filters before test - [`c3e5624`](https://github.com/radzenhq/radzen-blazor/commit/c3e56243cc5b509300f0b8ddf3023461db6f059f) In Sorting Tests - [`1ef6d40`](https://github.com/radzenhq/radzen-blazor/commit/1ef6d40ffa66e3d0a9669112c3ab58a84a3dc4f9) Filter by ChecBoxList to be done - [`c134f27`](https://github.com/radzenhq/radzen-blazor/commit/c134f2751ee96ef6eee8e30cb78c69890642ffc4) Better solution to filter types - [`e41553e`](https://github.com/radzenhq/radzen-blazor/commit/e41553ee4f0b7563b63db14777b4916ff38e1f74) Solution for Enum in DataTable - [`b94ddad`](https://github.com/radzenhq/radzen-blazor/commit/b94ddad0018c1c107004f6ca0140f9a65949bb4d) Tidy up and fix of Enum Null - [`0768915`](https://github.com/radzenhq/radzen-blazor/commit/0768915777c4e9b8398154acbd71ec7dd12426ef) Re-enabled all data sources in tests - [`238bc0d`](https://github.com/radzenhq/radzen-blazor/commit/238bc0d31de970121ae7bbe321e46b47b05b69fa) Prevent display of simple filter input when fitler expects enumerable ### 📊 Changes **16 files changed** (+1706 additions, -21 deletions) <details> <summary>View changed files</summary> ➕ `Radzen.Blazor.Tests/Integration/DataFixture.cs` (+173 -0) ➕ `Radzen.Blazor.Tests/Integration/DataGridFilterTests.cs` (+514 -0) ➕ `Radzen.Blazor.Tests/Integration/DataGridSortTests.cs` (+238 -0) ➕ `Radzen.Blazor.Tests/Integration/Employee.cs` (+152 -0) ➕ `Radzen.Blazor.Tests/Integration/Employees.json` (+182 -0) 📝 `Radzen.Blazor.Tests/Radzen.Blazor.Tests.csproj` (+6 -0) 📝 `Radzen.Blazor/Common.cs` (+5 -1) 📝 `Radzen.Blazor/QueryableExtension.cs` (+67 -4) 📝 `Radzen.Blazor/RadzenDataGrid.razor` (+1 -1) 📝 `Radzen.Blazor/RadzenDataGridColumn.razor.cs` (+19 -10) 📝 `Radzen.Blazor/RadzenDataGridHeaderCell.razor` (+8 -3) 📝 `RadzenBlazorDemos/Pages/DataGridColumnEnumFilterPage.razor` (+27 -2) ➕ `RadzenBlazorDemos/Pages/DataGridColumnEnumFilterTable.razor` (+115 -0) ➕ `RadzenBlazorDemos/Pages/DataGridDataTable.razor` (+143 -0) ➕ `RadzenBlazorDemos/Pages/DataGridDataTablePage.razor` (+48 -0) 📝 `RadzenBlazorDemos/Services/ExampleService.cs` (+8 -0) </details> ### 📄 Description The objective is to use native display, filter and sort in a DataGrid<DataRow> This does not work atm as the DataRow.ItemArray[] returns object which cannot be filtered, but if DataColumn Type property is set then the propertyValueGetter is not set. The changes: public static Type GetPropertyType(Type type, string property)// returns type of underlying array type when type==array<type>[] GetNestedPropertyExpression(Expression expression, string property, Type type = null)// adds a Converter when property is array<T>[] and T != type protected override void OnInitialized() // changes the logic here so that both Type can be set and propertyValueGetter is set under these circumstances The last is the change most needing of review. I have altered existing logic without fully understanding what it is handling. Maybe the logic should be added to handle the specific case where the underlying data object type != Type --- <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:22:08 +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#3145