[DataGrid] Skip debounce delay on first provider call when using virtualize#4678
Closed
JamesNK wants to merge 1 commit intomicrosoft:mainfrom
Closed
[DataGrid] Skip debounce delay on first provider call when using virtualize#4678JamesNK wants to merge 1 commit intomicrosoft:mainfrom
JamesNK wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Eliminates the unconditional 100ms Task.Delay in ProvideVirtualizedItemsAsync on the first call, improving initial load performance for FluentDataGrid with Virtualize=true and ItemsProvider. Subsequent calls during scrolling still get debounced as before. Fixes microsoft#4676
5ff9081 to
eafab98
Compare
vnbaaij
previously approved these changes
Apr 7, 2026
Collaborator
|
Hi @JamesNK please re-target this PR to go to the |
vnbaaij
added a commit
that referenced
this pull request
Apr 7, 2026
Collaborator
|
Rolled up into #4680. Thanks again for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix FluentDataGrid initial load performance
Fixes #4676
Problem
ProvideVirtualizedItemsAsyncunconditionally callsawait Task.Delay(100)before every request, including the very first one on page load. This introduces an artificial 100ms delay before grid rows are displayed, even when theItemsProvidercallback is synchronous.Solution
Added a
_isFirstVirtualizeProviderCallboolean field that skips the debounce delay on the first call. Subsequent calls (e.g., during scrolling) continue to be debounced as before.Also fixed a pre-existing IDE0048 build error (missing parentheses for clarity) on the same file.
Changes
FluentDataGrid.razor.cs: SkipTask.Delay(100)on the firstProvideVirtualizedItemsAsynccallFluentDataGrid.razor.cs: Add parentheses toEffectiveLoadingValueexpression to fix IDE0048