0

I would like to enter "All" as an <option> that gets bound to @pagination.ItemsPerPage" in the MS QuickGrid.

The setting when selected is ignore.

H H
  • 263,252
  • 30
  • 330
  • 514

2 Answers2

1

It seems the Pagination type has been replaced with PaginationState. I found a solution...

<select @bind="@pagination.ItemsPerPage"> 
     <option>5</option> 
     <option>10</option> 
     <option>15</option> 
     <option>20</option> 
     <option>25</option> 
     <option value="@pagination.TotalItemCount">All</option>
</select>
0

Had then an issue where QuickGrid generated a number of blank lines when the data source was filtered. Had to comment out some lines in the QuickGrid code...

private void RenderNonVirtualizedRows(RenderTreeBuilder __builder)
{
    var initialRowIndex = 2; // aria-rowindex is 1-based, plus the first row is the header
    var rowIndex = initialRowIndex; 
    foreach (var item in _currentNonVirtualizedViewItems)
    {
        RenderRow(__builder, rowIndex++, item);
    }

    // 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)
    //{
    //    while (rowIndex++ < initialRowIndex + Pagination.ItemsPerPage)
    //    {
    //        <tr></tr>
    //    }
    //}
}

Works now! :-)

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 17 '23 at 02:45