Skip to content

QuickGrid: Adds option to disable rendering of filler rows #62607

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -10,6 +10,11 @@ namespace Microsoft.AspNetCore.Components.QuickGrid;
/// </summary>
public class PaginationState
{
/// <summary>
/// Whether or not to render empty rows to fill the view.
/// </summary>
public bool RenderFillerRows { get; set; } = true;

/// <summary>
/// Gets or sets the number of items on each page.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -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<TGridItem>.HideColumnOptionsAsync() -> System.Threading.Tasks.Task!
Microsoft.AspNetCore.Components.QuickGrid.QuickGrid<TGridItem>.RowClass.get -> System.Func<TGridItem, string?>?
Microsoft.AspNetCore.Components.QuickGrid.QuickGrid<TGridItem>.RowClass.set -> void
Microsoft.AspNetCore.Components.QuickGrid.QuickGrid<TGridItem>.RowClass.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,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)
{
Expand Down
Loading