diff --git a/Maui.DataGrid/DataGrid.xaml.cs b/Maui.DataGrid/DataGrid.xaml.cs index 823f4f1..97cb1c6 100644 --- a/Maui.DataGrid/DataGrid.xaml.cs +++ b/Maui.DataGrid/DataGrid.xaml.cs @@ -38,7 +38,7 @@ public partial class DataGrid private readonly object _reloadLock = new(); private readonly object _sortAndPaginateLock = new(); private DataGridColumn? _sortedColumn; - private static HashSet? _internalItemsHashSet; + private HashSet? _internalItemsHashSet; #endregion Fields @@ -406,7 +406,8 @@ private void SortAndPaginate(SortData? sortData = null) return; } - _internalItemsHashSet = null; + // Reset internal hash set, used for fast lookups + self._internalItemsHashSet = null; // Unsubscribe from old collection's change event if (o is INotifyCollectionChanged oldCollection)