When using a text filter in DataGrid2, the grid refreshes on every change. Since the selection is kept as a UI state, it gets reset during this refresh, which is why multi-row selection is lost when a filter is applied. The simplest way to preserve the selection is not to rely on DataGrid2 itself, but to store the selected rows in a separate helper/selection entity. You update this helper in the selection change event, and when the grid refreshes due to filtering, you restore the selection from this stored list. Because DataGrid2 does not provide a built-in option to automatically keep the selection after a refresh, this “store externally and reapply after refresh” approach is the most stable solution. If you run into any issues while implementing this, feel free to share screenshots and I’ll try to help.
hi,
This is expected behavior in DataGrid2.
When you apply or change a column filter, DataGrid2 refreshes its data source, and during that refresh the grid loses its internal selection state. Currently, DataGrid2 does not automatically preserve row selection across filtering.
You need to manage the selection yourself:
There is no built-in setting in DataGrid2 to keep selections when filters change. This is a current limitation of the widget.