From 1c3cff049d07493a5b2c1a61914754f4ef46a734 Mon Sep 17 00:00:00 2001 From: Adam Shortland Date: Tue, 8 Jul 2025 10:36:21 -0400 Subject: [PATCH 1/2] QuickGrid: Adds option to disable rendering of filler rows #57199 #59096 --- .../src/Pagination/PaginationState.cs | 5 +++++ .../src/QuickGrid.razor | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Pagination/PaginationState.cs b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Pagination/PaginationState.cs index 2da161a7af9a..f2406da16f87 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Pagination/PaginationState.cs +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Pagination/PaginationState.cs @@ -10,6 +10,11 @@ namespace Microsoft.AspNetCore.Components.QuickGrid; /// public class PaginationState { + /// + /// Whether or not to render empty rows to fill the view. + /// + public bool RenderFillerRows = true; + /// /// Gets or sets the number of items on each page. /// diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor index 5228ed1d2b00..860d25e14f9b 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor @@ -49,7 +49,7 @@ // When pagination is enabled, by default ensure we render the exact number of expected rows per page, // even if there aren't enough data items. This avoids the layout jumping on the last page. // Consider making this optional. - if (Pagination is not null) + if (Pagination is not null && Pagination.RenderFillerRows) { while (rowIndex++ < initialRowIndex + Pagination.ItemsPerPage) { From 2d500976ab99faee9a624e071b603c8372a85ba1 Mon Sep 17 00:00:00 2001 From: Adam Shortland Date: Tue, 8 Jul 2025 10:38:14 -0400 Subject: [PATCH 2/2] Removes comment about making filler rows optional --- .../src/QuickGrid.razor | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor index 860d25e14f9b..134583659d4a 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor @@ -48,7 +48,6 @@ // When pagination is enabled, by default ensure we render the exact number of expected rows per page, // even if there aren't enough data items. This avoids the layout jumping on the last page. - // Consider making this optional. if (Pagination is not null && Pagination.RenderFillerRows) { while (rowIndex++ < initialRowIndex + Pagination.ItemsPerPage)