Select All - too slow

Hello team!

I have problems selecting all records in a DataGrid when there are many results. I mean, I have a query with a 10,000 results cap, but if the user doesn't apply filters and clicks directly on the select all box, the response time is too long.

Is there any way to select only the results of the page? That is, if I limit the number of PageSize to 40 (for example), that when I click on this box, only these 40 are selected?

Currently, my code is:

Translated with DeepL.com (free version)

<RadzenDataGridColumn Width ="60px" Sortable ="false" Filterable ="false">

<HeaderTemplate >

<RadzenCheckBox TabIndex ="-1" TriState ="false" TValue ="bool?" InputAttributes ="@(new Dictionary<string,object>(){ { "aria-label", "Select all items" }})"

Value ="@(seleccionOFCropu == null || seleccionOFCropu?.Any() != true ? false : !pmsMsOrdens.All(i => seleccionOFCropu.Contains(i)) ? null : pmsMsOrdens.Any(i => seleccionOFCropu.Contains(i)))"

Change ="@(args => seleccionOFCropu = args == true ? grid0.View.ToList() : null)" />

</HeaderTemplate >

<Template Context ="data">

<RadzenCheckBox TabIndex ="-1" TriState ="false" Value ="@(seleccionOFCropu != null && seleccionOFCropu.Contains(data))" InputAttributes ="@(new Dictionary<string,object>(){ { "aria-label", "Select item" }})"

TValue ="bool" Change =@(args => { if(!allowRowSelectOnRowClick) { grid0.SelectRow(data); }}) />

</Template >

</RadzenDataGridColumn >

One more time, thanks a lot for your time.

The implementation that you are using selects all items. You can adapt it to your preference so it selects only one page of items.

1 Like

Once again, thank you for your support and your time. Your work is amazing.

@alberto.ramirez
I had the same behaviour, but only on the first "select all" click. Second and ongoing clicks reacting pretty fast. In my case this was the solution:

1 Like

Thanks for your answer fabius916. I will tray and I will let you know the results.
Regards.

This code is no longer needed as it is already built-in in Radzen.Blazor. @alberto.ramirez should just follow my advice and change the select all implementation that he has to one that uses only the current page of data. The View property of RadzenDataGrid returns that.

1 Like

Thanks Korchev. I followed your instructions and It´s working properlly.

Regards.