Declined
Last Updated: 18 Aug 2026 14:00 by ADMIN
Scheduled for 2026 Q3 (Aug)
César
Created on: 09 Jul 2024 15:19
Category: Grid
Type: Bug Report
2
Unable to unselect all Grid items with header checkbox when Grid is inside ChildContent

We have a grid with a GridCheckboxColumn that we have configured through a '.unselectable-row' style so that certain elements cannot be selected (those elements with a padlock in the second column cannot be selected).

The grid works correctly in isolation, but when we add a TelerikLoaderContainer that is displayed during data loading process, the grid doesn't working properly: it is possible to select all the enabled elements of the grid using the button in the header of the checkbox column. However it is not possible to deselect them from the button in the header of the checkbox column when there is any unselectable element.

Here it is a link to REPL with a reproducible example: https://blazorrepl.telerik.com/GyYhYXPI24gIYgIJ03

To reproduce the problem, you sholud select all grid elements from the checkbox column header button and try to deselect them. You will not be able to deselect all the elements. 
Now comment the LoaderContainer component and repeat the test. You will see that now it is possible to deselect correctly all the elements.

How can we deselect all the elements from the header while keeping the loadercontainer?

2 comments
ADMIN
Dimo
Posted on: 05 Aug 2026 08:43

Hello again,

We are closing this bug, because the problem is not in the Grid, but in the SelectedItemsChanged handler logic. Here is what happens:

  1. The Grid renders with no selected rows.
  2. The user clicks on the Select All checkbox.
  3. The Grid fires SelectedItemsChanged with all rows in the event argument.
  4. The handler overrides and reduces the selected rows based on business logic.
  5. Now the Grid knowns that only some rows are selected. The Select All checkbox is indeterminate.
  6. (same as 2) The user clicks on the Select All checkbox.
  7. (same as 3) The Grid fires SelectedItemsChanged with all rows in the event argument.

The above represents an endless loop, because the Grid's Select All checkbox' primary action is to select all rows if some of them are still not selected. When the Grid is inside another component, this leads to another render, which makes the problem visible, but does not cause the problem itself. The Grid SelectedItemsChanged handler must be reworked in order to achieve the desired behavior. Here is a possible option:

https://blazorrepl.telerik.com/wqOiuTui31uCMPdx53

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Dimo
Posted on: 10 Jul 2024 14:22

Hi César,

Thank you for the runnable REPL test page.

That's a very peculiar problem indeed. It seems to be related to the combination of two things:

  • The Grid is inside the ChildContent parameter of a component.
  • The selected items are overridden on the fly.

It's not clear what exactly is causing the difference in behavior, so we will have to invest more time for research when we get to this.

In the meantime:

You may need to adjust the logic to match better your scenario. The idea is to detect when the "changed" selected items actually match the current ones.

    private void OnSelect(IEnumerable<Product> selectedProducts)
    {
        int newSelectedItemsCount = selectedProducts.Count();
        int allItemsCount = Math.Min(GridPageSize, GridData.Count());
        int discontinuedCount = GridData.Where(x => x.Discontinued).Count();

if (newSelectedItemsCount == allItemsCount && discontinuedCount > 0 && SelectedReasons.Count() == allItemsCount - discontinuedCount) { SelectedItems = new List<Product>(); SelectedReasons = new List<Product>(); } else { SelectedItems = selectedProducts.Where(x => !x.Discontinued).ToList(); SelectedReasons = selectedProducts.Where(x => !x.Discontinued); } }

 

Regards,
Dimo
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!