Open hakenr opened 3 days ago
For now, I decided to implement a straightforward solution that leaves room for future enhancements:
Developers will be required to set PreserveSelection="true"
when using MultiSelectionEnabled="true"
in InfiniteScroll
content navigation mode. Setting PreserveSelection="false"
in this scenario will throw an exception from OnParametersSet
.
The "select/deselect all" checkbox will be hidden in InfiniteScroll
mode for now.
SelectAllChecked
parameter - later if needed. SelectedDataItems
contains any selected items. This approach is simple, tackles the current challenges, and allows flexibility for future improvements.
As we implemented the
PreserveSelection
parameter (#576), it now opens the door to supporting multiselection forInfiniteScroll
(virtualized) mode.There are a few design challenges we need to address:
Dependency on
PreserveSelection="true"
The multiselection feature only makes sense with
PreserveSelection="true"
. AllowingPreserveSelection="false"
in virtualized grids with multiselection would create conflicts.PreserveSelection="true"
when the feature is used, or should we introduce an automatic default likePreserveSelection="null"
? This default would act as "true for InfiniteScroll and false for others."null
is already used for "cascade inheritance," meaning "not set, use the value from parent settings" (supporting the Defaults-Settings-parameter cascade outlined in Defaults & Settings).PreserveSelection
, such as:GridPreserveSelection.Enabled
GridPreserveSelection.Disabled
GridPreserveSelection.Automatic
(though this naming might feel odd, since there's no true "automation" in preserving selection - it's just enabled for InfiniteScroll and disabled for other modes).Handling the "select/deselect all" checkbox
Virtualization complicates the "select/deselect all" functionality since there’s no clear concept of "visible rows" (due to overscan and other factors, making the feature unpredictable for users). Possible solutions:
TotalCount
, i.e., when all items are effectively displayed regardless of navigation mode.bool SelectAllChecked
, mapping to the checkbox state. Leave theSelectedDataItems
collection empty in such a state, allowing developers to implement custom logic (e.g., handling actions on all items without loading them into the grid). However, this approach adds complexity, which might not be desirable.cc @crdo @jirikanda