our customer reported an annoying problem to us related to XamDataGrid.
Hers's the situation:
Why does this happen??
I would understand a de-selection of records taht are invisible due to filter values, but there's no reason to de-select in case of clearing filters.
How can we preserve the selection?
I have been investigating into this behavior you are reporting with lost selection when clearing filters, and I have reproduced it. It appears that this is happening as the "FilterRecord" is essentially trying to steal the selected status of the grid. For example, if you were to hold the Ctrl or Shift key down with multiple selection active in the XamDataGrid, you would retain your selection.
Another workaround in this case would be to cache the selected records, possibly by listening to the SelectedItemsChanged event of the XamDataGrid and accessing the XamDataGrid.SelectedItems.Records collection. In doing this, you could also listen to the RecordFilterChanged event of the grid and check the e.RecordFilter.Conditions collection to see if it is empty (where e is the event arguments) to potentially catch a filter clearing. If you catch this, and the cached record(s) are not null, you can then push them back into the XamDataGrid.SelectedItems.Records collection.
I have attached a sample project demonstrating this workaround.
This is unexpected behavior, and as such, I have asked our engineering staff to examine it further. To ensure it receives attention, I have logged the issue in our internal tracking systems with a development ID of 251493. I have also created a private support case for you so that you can track the progress of this issue and be notified when a fix becomes available. This support case has an ID of CAS-194895-T2Z3K5 and you can access it after signing into your Infragistics account at https://www.infragistics.com/my-account/support-activity.
Please let me know if you have any other questions or concerns on this matter.
thank your for the quick response. The workaround works great!
Best care anywhere!