Hello
For a recent project I have to display around 100 000 rows in a grid, I have to be able to sort/filter and select certain rows/select all rows in a filter.
Because it's quite a lot of data I've decided to use the OnRead event on the TelerikGrid, this all seems to work fine except for the ability to select all rows (only the rows on the current page are selected). The grid looks something like this:
The code looks something like this:
<TelerikGrid AutoGenerateColumns=true
OnRead="@ReadItems"
TItem=ProductDto
Pageable=true
PageSize=10
Sortable
SelectionMode=@GridSelectionMode.Multiple
FilterMenuType=@FilterMenuType.Menu
FilterMode="GridFilterMode.FilterMenu"
Resizable="true"
ScrollMode="@GridScrollMode.Scrollable"
SelectedItemsChanged="@((IEnumerable<ProductDto> newSelection) => onSelect(newSelection))"
Reorderable="true"
SelectedItems="@selectedProducts"
>
<GridColumns>
<GridCheckboxColumn CheckBoxOnlySelection="true" Reorderable=false SelectAllMode=@GridSelectAllMode.All Width="100px" SelectAll="true" Locked="true" />
<GridColumn Field="@nameof(ProductDto.Id)" Title="@_localizer[nameof(Translations.Id)]" Width="100px" Locked="true" />
<GridColumn Field="@nameof(ProductDto.Code)" Title="@_localizer[nameof(Translations.Code)]" Width="200px" Locked="true" />
<GridColumn Field="@nameof(ProductDto.ExternalReference)" Title="@_localizer[nameof(Translations.ExternalReference)]" Width="200px" Locked="true" Lockable="true" />
<GridColumn Field="@nameof(ProductDto.Description)" Title="@_localizer[nameof(Translations.Description)]" Width="200px" Lockable="true" />
<GridColumn Field="@nameof(ProductDto.BrandCode)" Title="@_localizer[nameof(Translations.BrandCode)]" Width="200px" Lockable="true" />
<GridAutoGeneratedColumns ColumnWidth="200px" />
</GridColumns>
</TelerikGrid>
Since I use the OnRead event, only a small amount of data is available client side, when I click the header checkbox of the GridCheckboxColumn all the items that are available client-side get selected BUT, I would like to be able to tell whether a user clicked the checkbox in the header (=select everything in the grid), or if the user just manually selected all the visible rows of a certain page.
TLDR: How to determine whether a user clicked the header checkbox (= select everything) vs a user manually clicked all items on a certain page. (The selectedItems result is both the same)
Kind regards
Thomas