I have an XamGrid with large amounts of data (only a couple columns, but potentially 100,000 or more rows).
Using XamGrid.Rows.RemoveRange but having performance issues...
I've drastically improved performance by doing 3 things so far
Clear SelectionSettings.SelectedRows (store in separate List so I know what to remove)
Clear filters (grid.FilteringSettings.RowFiltersCollection) (store in List)
Clear sort columns (grid.SortingSettings.SortedColumns) (store in List)
call RemoveRange
Then readd filters and sort.
This seems to improve performance when deleting but I'm currently down to 5000 rows in 24 seconds. Is there anyway to improve this further? Is there anyway to temporarily deactivate binding or grid updating while I remove rows from the underlying collection?
I tried setting grid.ItemsSource to null thinking I could then work with the collection, and then reassign it at the end but setting ItemsSource to null, also nulled out the underlying collection.
Any ideas would be appreciated. The speed isn't horrible but I think it could be improved.
HI,
Try removing the data from your collection (if it’s an ObservableCollection).
That should be quicker than going through the XamGrid.
Sincerely, Matt Developer Support Engineer