Skip to content

Single QuickGrid Does Not Support Multiple Paginators #57289

@jvs7315

Description

@jvs7315

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In the latest QuickGrid documentation, it's stated that a single <QuickGrid> instance supports multiple paginators (emphasis added):

To provide a UI for pagination, add a Paginator component above, below, or both above and below the QuickGrid component.

However, when two <Paginator> component instances are assigned to the same PaginationState instance, changing the page number via one <Paginator> will not cause the UI of the other <Paginator> to rerender. This causes the other <Paginator> to display an incorrect page number, and it allows that <Paginator>'s page change buttons to navigate beyond the valid range of page numbers.

Expected Behavior

Two or more <Paginator> components linked to the same PaginationState instance should all rerender when one <Paginator> changes the current page number.

Steps To Reproduce

Repro code, based on Microsoft's QuickGrid sample code:

<Paginator State="@pagination" />

<QuickGrid Items="@people" Pagination="@pagination">
    <PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
    <PropertyColumn Property="@(p => p.Name)" Sortable="true" />
    <PropertyColumn Property="@(p => p.BirthDate)" Format="yyyy-MM-dd" Sortable="true" />
</QuickGrid>

<Paginator State="@pagination" />

@code {
    PaginationState pagination = new PaginationState() { ItemsPerPage = 1 };

    record Person(int PersonId, string Name, DateOnly BirthDate);

    IQueryable<Person> people = new[]
    {
        new Person(10895, "Jean Martin", new DateOnly(1985, 3, 16)),
        new Person(10944, "António Langa", new DateOnly(1991, 12, 1)),
        new Person(11203, "Julie Smith", new DateOnly(1958, 10, 10)),
        new Person(11205, "Nur Sari", new DateOnly(1922, 4, 27)),
        new Person(11898, "Jose Hernandez", new DateOnly(2011, 5, 3)),
        new Person(12130, "Kenji Sato", new DateOnly(2004, 1, 9)),
    }.AsQueryable();
}

Exceptions (if any)

No response

.NET Version

8.0.300

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions