(sfDataGrid) I would like to keep the currently selected rows when the user filters the data using the built in column filtering options. I am using a GridCheckBoxSelectorColumn to select the rows.
Hi Bob Bachman,
By default, when filtering the SfDataGrid using the built-in column filtering, the selected items are maintained. Please find the sample and the video reference in the attachment.
Is your requirement to maintain the selected items even if those selected items are not included in the filtered results? If we have misunderstood your requirement, please provide more information. If possible, provide a video reference to demonstrate the requirement. This would help us to validate further.
Regards,
Sreemon Premkumar M.
Yes i wasn't clear. I need to preserve the selection even if the filter results do not include that selection. My use case: I have a grid with about 1000 rows that the user uses to s=make a selection of a number of rows. In order to avoid excessive scrolling, the user can filter the rows and select more rows. He repeatedly does this until all the desired rows are selected. I've thought of a number of workarounds like adding the selected items to a different list when filtering but I was hoping there was a much easier way to preserve the selection across filtering.
Hi Bob Bachman,
In SfDataGrid, we have support for searching data using the SfDataGrid.SearchHelper.Search("") method. You can search for specific data and select it. Please find the code snippet below.
Code snippet:
private void Searchbox_TextChanged(object sender, TextChangedEventArgs e) { this.dataGrid.SearchHelper.Search(Searchbox.Text); } |
We have prepared the sample and based on your requirement with video reference, please find it in the attachment.
For more information to searching, please refer the below user guide documentation.
UG link: https://help.syncfusion.com/wpf/datagrid/search#filtering
Regards,
Sreemon Premkumar M.
Thank you very much - I appreciate it. That solves my problem.
Hi Bob Bachman,
We are glad that the provided solution solved your problem. If you need any further assistance, please let us know.
Regards,
Sreemon Premkumar M.