From c252cb1ed7dce422f75ded6061625f59f64850ab Mon Sep 17 00:00:00 2001 From: Adam Shortland Date: Tue, 8 Jul 2025 10:36:21 -0400 Subject: [PATCH 1/4] 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 0177db473d132873d7b07941803efc34c9ebd51f Mon Sep 17 00:00:00 2001 From: Adam Shortland Date: Tue, 8 Jul 2025 10:38:14 -0400 Subject: [PATCH 2/4] 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) From 69cb4e531eaba02065f8cb2446e7aed15df3ca6d Mon Sep 17 00:00:00 2001 From: Adam Shortland Date: Tue, 8 Jul 2025 12:58:37 -0400 Subject: [PATCH 3/4] -Makes RenderFillerRows a property and adds it to PublicAPI.Shipped.txt --- .../src/Pagination/PaginationState.cs | 2 +- .../src/PublicAPI.Shipped.txt | 2 ++ 2 files changed, 3 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 f2406da16f87..4aa921fee4ed 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 @@ -13,7 +13,7 @@ public class PaginationState /// /// Whether or not to render empty rows to fill the view. /// - public bool RenderFillerRows = true; + public bool RenderFillerRows { get; set; } = true; /// /// Gets or sets the number of items on each page. diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt index 1b580b50deff..47a84a90c290 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt @@ -78,6 +78,8 @@ Microsoft.AspNetCore.Components.QuickGrid.PaginationState.ItemsPerPage.get -> in Microsoft.AspNetCore.Components.QuickGrid.PaginationState.ItemsPerPage.set -> void Microsoft.AspNetCore.Components.QuickGrid.PaginationState.LastPageIndex.get -> int? Microsoft.AspNetCore.Components.QuickGrid.PaginationState.PaginationState() -> void +Microsoft.AspNetCore.Components.QuickGrid.PaginationState.RenderFillerRows.get -> bool +Microsoft.AspNetCore.Components.QuickGrid.PaginationState.RenderFillerRows.set -> void Microsoft.AspNetCore.Components.QuickGrid.PaginationState.SetCurrentPageIndexAsync(int pageIndex) -> System.Threading.Tasks.Task! Microsoft.AspNetCore.Components.QuickGrid.PaginationState.TotalItemCount.get -> int? Microsoft.AspNetCore.Components.QuickGrid.PaginationState.TotalItemCountChanged -> System.EventHandler? From 826b8c3a04f4bf4de63768df051c415898c6c369 Mon Sep 17 00:00:00 2001 From: Adam Shortland Date: Tue, 8 Jul 2025 14:16:32 -0400 Subject: [PATCH 4/4] Moves to Unshipped --- .../src/PublicAPI.Shipped.txt | 2 -- .../src/PublicAPI.Unshipped.txt | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt index 47a84a90c290..1b580b50deff 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Shipped.txt @@ -78,8 +78,6 @@ Microsoft.AspNetCore.Components.QuickGrid.PaginationState.ItemsPerPage.get -> in Microsoft.AspNetCore.Components.QuickGrid.PaginationState.ItemsPerPage.set -> void Microsoft.AspNetCore.Components.QuickGrid.PaginationState.LastPageIndex.get -> int? Microsoft.AspNetCore.Components.QuickGrid.PaginationState.PaginationState() -> void -Microsoft.AspNetCore.Components.QuickGrid.PaginationState.RenderFillerRows.get -> bool -Microsoft.AspNetCore.Components.QuickGrid.PaginationState.RenderFillerRows.set -> void Microsoft.AspNetCore.Components.QuickGrid.PaginationState.SetCurrentPageIndexAsync(int pageIndex) -> System.Threading.Tasks.Task! Microsoft.AspNetCore.Components.QuickGrid.PaginationState.TotalItemCount.get -> int? Microsoft.AspNetCore.Components.QuickGrid.PaginationState.TotalItemCountChanged -> System.EventHandler? diff --git a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Unshipped.txt b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Unshipped.txt index a5806f90a9db..fb5f3da11159 100644 --- a/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Unshipped.txt +++ b/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Unshipped.txt @@ -1,4 +1,6 @@ #nullable enable +Microsoft.AspNetCore.Components.QuickGrid.PaginationState.RenderFillerRows.get -> bool +Microsoft.AspNetCore.Components.QuickGrid.PaginationState.RenderFillerRows.set -> void Microsoft.AspNetCore.Components.QuickGrid.QuickGrid.HideColumnOptionsAsync() -> System.Threading.Tasks.Task! Microsoft.AspNetCore.Components.QuickGrid.QuickGrid.RowClass.get -> System.Func? -Microsoft.AspNetCore.Components.QuickGrid.QuickGrid.RowClass.set -> void \ No newline at end of file +Microsoft.AspNetCore.Components.QuickGrid.QuickGrid.RowClass.set -> void