havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
468 stars 65 forks source link

[HxGrid] When using Multiselect & Pagination, the selection is removed when navigating to other page. #576

Open jim-craane opened 1 year ago

jim-craane commented 1 year ago

When using HXGrid with Multiselect & Pagination, the selection is removed when navigating to other page. Is this by design? Because it's very annoying.

Steps to reproduce:

  1. Go to https://havit.blazor.eu/components/HxGrid#multiselect
  2. Select some rows on first page
  3. Navigate to second page
  4. Navigate back to first page

Expected behaviour: Paging/Filtering/Sorting doesn't have any influence on selected items.

hakenr commented 1 year ago

This is currently intended behavior as the multi-selection is usually being used for mass-operations and we want the user to see affected items.

What is the scenario you are trying to solve and how do you expect the component to behave? Can you provide us with some links to other component implementations where this behaves as you expect?

jim-craane commented 1 year ago

Examples of datagrid multiselect with pagination in other blazor UI frameworks: https://blazor.radzen.com/datagrid-multiple-selection https://antblazor.com/en-US/components/table https://mudblazor.com/components/datagrid#advanced-data-grid

I expect that that the datagrid just stores the selected items also after navigating to the next page. People are responsible for them self's to select or not. The only thing with the 'select all' checkbox is that you can't select all on all pages with using server side sorting/filtering. But a lot of these datagrids are also used with just client side data.

So maybe make the row selection behavior configurable?

hakenr commented 1 year ago

Both Radzen and MudBlazor maintain selection when paging, but it seems Ant loses the selection. Currently, we've chosen not to preserve the selection. However, this could change if there's increased feedback or interest from our users. As of now, it's not on our priority list.