Skip to content

feat: add DataGrid virtualization options - #5193

Open
James Newton-King (JamesNK) wants to merge 8 commits into
microsoft:dev-v5from
JamesNK:feat/datagrid-virtualization-options
Open

feat: add DataGrid virtualization options#5193
James Newton-King (JamesNK) wants to merge 8 commits into
microsoft:dev-v5from
JamesNK:feat/datagrid-virtualization-options

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Pull Request

📖 Description

Adds virtualization controls to FluentDataGrid and forwards them to its internal Virtualize component.

  • Adds MaxItemCount for .NET 9 and later.
  • Adds .NET 11 support for InitialItemIndex, AnchorMode, ItemComparer, and ScrollToItemAsync.
  • Adapts ItemComparer to the grid's internal row-index/item tuple while comparing item identity only.
  • Adds .NET 11 Release targeting and installs the latest public .NET 11 SDK (Preview 7) in GitHub Actions and Azure Pipelines.
  • Updates DataGrid documentation and tests.
  • Resolves net11 compatibility diagnostics in existing Wizard and MCP Server code.

🎫 Issues

Closes #5158

👩‍💻 Reviewer Notes

The .NET 11 APIs are conditionally available under NET11_0_OR_GREATER. AnchorMode and ItemComparer are stable APIs in .NET 11 RC1 and are not annotated or documented as experimental.

The public item comparer is wrapped because the internal virtualizer operates on (rowIndex, item) tuples. The wrapper intentionally ignores row indexes and reads the current comparer so parameter updates take effect.

📑 Test Plan

  • dotnet build src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj --configuration Release (zero warnings/errors)
  • dotnet test tests/Core/Components.Tests.csproj --configuration Release -p:ExampleNetVersion=net11.0 (3,856 passed)
  • dotnet test tests/Core/Components.Tests.csproj --configuration Release --framework net9.0 (3,851 passed)
  • Focused Wizard advanced tests passed on net9.0.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

  • I have added a new component
  • I have added Unit Tests for my new component
  • I have modified an existing component
  • I have validated the Unit Tests for an existing component

MCP Server

  • I have added or updated MCP Server tools/prompts/resources
  • I have added Unit Tests for my MCP Server changes

⏭ Next Steps

Update the .NET 11 SDK and package pins when the next public .NET 11 release is published.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new .NET-version-specific virtualization controls to FluentDataGrid (forwarded to its internal Virtualize component), and updates CI/build configuration to include net11.0 builds/tests.

Changes:

  • Exposes virtualization options (MaxItemCount for net9+; InitialItemIndex, AnchorMode, ItemComparer, ScrollToItemAsync for net11+) and forwards them to the underlying Virtualize.
  • Adds/updates DataGrid and Wizard tests (including net11-only coverage) and updates DataGrid virtualization documentation.
  • Expands multi-targeting and CI pipelines/workflows to build/test with net11.0 (preview SDK), plus minor net11 compatibility fixes.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Core/Components/Wizard/FluentWizardAdvancedTests.razor Suppresses obsolete warning around EditContext.Validate() usage in tests.
tests/Core/Components/DataGrid/FluentDataGridTests.razor Adds tests for new virtualization parameters and ScrollToItemAsync behavior.
src/Tools/McpServer/Services/MigrationService.cs Uses StartsWith(..., StringComparison.Ordinal) to satisfy string-comparison diagnostics.
src/Tools/McpServer/Services/DocumentationService.cs Uses StartsWith(..., StringComparison.Ordinal) to satisfy string-comparison diagnostics.
src/Core/Components/Wizard/FluentWizardStep.razor.cs Suppresses CS0618 for EditContext.Validate() usage and documents follow-up to adopt async validation later.
src/Core/Components/Wizard/FluentWizard.razor.cs Removes redundant StateHasChanged() calls after next/previous navigation.
src/Core/Components/DataGrid/FluentDataGrid.razor.cs Adds new public virtualization parameters and net11 ScrollToItemAsync, plus tuple comparer adaptation.
src/Core/Components/DataGrid/FluentDataGrid.razor Switches to a RenderTreeBuilder-based Virtualize render to conditionally forward new parameters.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/DataGrid/Pages/DataGridVirtualizePage.md Documents net11 positioning/anchoring APIs and sample usage.
eng/pipelines/build-core-lib.yml Installs .NET 11 preview SDK for Azure Pipelines builds.
eng/pipelines/build-all-lib.yml Installs .NET 11 preview SDK for Azure Pipelines builds.
Directory.Build.props Adds net11.0 to Release multi-targeting and suppresses BL0016 for net11.
.github/workflows/build-core-lib.yml Adds .NET 11 SDK setup and a net11 test run in GitHub Actions.
_ListOutdatedDependencies.ps1 Includes net11.0 in the dependency-audit loop.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Core/Components/DataGrid/FluentDataGrid.razor
Comment thread tests/Core/Components/DataGrid/FluentDataGridTests.razor
Comment thread tests/Core/Components/DataGrid/FluentDataGridTests.razor Outdated
@JamesNK
James Newton-King (JamesNK) force-pushed the feat/datagrid-virtualization-options branch 3 times, most recently from b949ea9 to 16142e0 Compare August 23, 2026 09:44
@vnbaaij

Copy link
Copy Markdown
Collaborator

This is great stuff!

@JamesNK
James Newton-King (JamesNK) force-pushed the feat/datagrid-virtualization-options branch from 16142e0 to e30f245 Compare August 23, 2026 13:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj Outdated
@vnbaaij
Vincent Baaij (vnbaaij) enabled auto-merge (squash) August 25, 2026 07:29
auto-merge was automatically disabled August 28, 2026 04:19

Head branch was pushed to by a user without write access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants