Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add amendable OverscanCount parameter to the QuickGrid for virtualization. #55078

Merged
merged 13 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#nullable enable
Microsoft.AspNetCore.Components.QuickGrid.QuickGrid<TGridItem>.OverscanCount.get -> int
Microsoft.AspNetCore.Components.QuickGrid.QuickGrid<TGridItem>.OverscanCount.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Virtualize @ref="@_virtualizeComponent"
TItem="(int RowIndex, TGridItem Data)"
ItemSize="@ItemSize"
OverscanCount="@OverscanCount"
ItemsProvider="@ProvideVirtualizedItems"
ItemContent="@(item => builder => RenderRow(builder, item.RowIndex, item.Data))"
Placeholder="@(placeholderContext => builder => RenderPlaceholderRow(builder, placeholderContext))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ public partial class QuickGrid<TGridItem> : IAsyncDisposable
/// </summary>
[Parameter] public bool Virtualize { get; set; }

/// <summary>
/// This is applicable only when using <see cref="Virtualize"/>. It defines how many additional items will be rendered
/// before and after the visible region to reduce rendering frequency during scrolling. While higher values can improve
/// scroll smoothness by rendering more items off-screen, they can also increase initial load times. Finding a balance
/// based on your data set size and user experience requirements is recommended. The default value is 3.
/// </summary>

SteveSandersonMS marked this conversation as resolved.
Show resolved Hide resolved
[Parameter] public int OverscanCount { get; set; } = 3;

/// <summary>
/// This is applicable only when using <see cref="Virtualize"/>. It defines an expected height in pixels for
/// each row, allowing the virtualization mechanism to fetch the correct number of items to match the display
Expand Down
Loading