[Grid]: Multiple selection and paging not work togehter

Aperta
#1,142 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
bootstrap, csharp
Ambito
frontend

Direzione di ricerca

Start by locating the Grid component’s client-side DataProvider, paging, and multiple-selection handling; the issue names no source files or tests. Reproduce by selecting items, changing pages, and checking whether selection remains visible and SelectedItemsChanged fires as expected. Done when selections persist across page changes in the described setup.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have a Grid with AllowPaging, AllowSelection, and SelectionMode="GridSelectionMode.Multiple". I configured a DataProvider for client-side mode.

Selection and paging work, but when I select some items and then change the page, the selection is cleared. I tried storing SelectedItems in a local variable, but that didn't help.

I also noticed that every time I change the page, the SelectedItemsChanged function is called. So, in that function I added something like:

if (items is not null && items.Count > 0)
{
    foreach (var item in items)
    {
        if (!SelectedItems.Any(s => s.Id == item.Id))
        {
            SelectedItems.Add(item);
        }
    }
}

to keep the selected items, but if I change page in a one with items selected, in the Grid those are non seletect.

I try also

private async Task<GridDataProviderResult<MyItem>> TableItemsResultDataProvider(GridDataProviderRequest<MyItem> request)
{
    var result = await Task.FromResult(request.ApplyTo(TableItems));
    itemsGrid.SelectedItems = SelectedItems;
    return result;
}

But items alread not selected.

Lingua principale
HTML
Stelle
1.2k
Fork
111
Merge medio
4m
PR unite (30g)
55

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vikramlearning/blazorbootstrap

Tutte le issue di vikramlearning/blazorbootstrap

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.