Posted 17 July 2023, 12:23 pm EST - Updated 17 July 2023, 12:28 pm EST
Summary: When using the MultiRange selection mode with AllowFiltering enabled in FlexGrid, selecting a range of visible rows also selects the hidden rows in between.
I have an issue with the FlexGrid Selection Mode, and the use of “AllowFiltering” that enables the column filters.
I have attached some sample code to highlight the issue.
-
If we use “ListBox” selection mode, then we do not have a problem. But with ListBox selection mode, we cannot copy the value of a single cell, as with ListBox selection mode, the whole role is highlighted.
-
We want to use “MultiRange” selection mode, because it allows us to have multiple selections, and also the ability to copy the text of a single cell.
The problem we experience is when a filter is applied to the grid by the user, then when they select a range of rows, it also selects the hidden rows.
You can see this problem by running the sample form I provided.
Steps to reproduce the issue:
- Click the “Description” column filter button, and select to show only “0”. This will hide half the rows.
- Select all 4 rows.
- Click the “Description” column filter button, and select to show all values.
- You will see that the rows in-between are also selected.
This does not happen if “ListBox” selection mode is used, which solves our problem. But ListBox introduces a new problem, that we cannot select and copy the value of a single cell.
Fix - I’m not sure if it’s possible, but I imagine one way around it is to have multiple selections created, instead of a single selection, when a selection is made within a filtered view. Because at the moment, it’s a bit misleading that rows are being selected that are not visible. Maybe AllowFiltering should not be allowed unless ListBox selection mode is used.
I hope what I’ve described makes sense… We would be happy with ListBox mode behaviour with the multirange selection mode, or to allow ListBox to select a single cell that we can copy. So maybe a modified version of ListBox that does not do a full row select?
I have attached the Project, and also screen shots of the problem.