Hello!
We have recently tried in our company to switch XamDataGrid in one of our products to grouping, sorting and filtering using CollectionView like that:
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings ... SortEvaluationMode="UseCollectionView" GroupByEvaluationMode="UseCollectionView" FilterEvaluationMode="UseCollectionView" SummaryEvaluationMode="UseLinq" /></igDP:XamDataGrid.FieldLayoutSettings>
Every 3 seconds 5000 records is added to the collection that is a datasource for the grid. The records are added in the UI thread. Some records contain child records. If, during the time of that recurring record addition, I try to do something in the grid, for example, expand some group or scroll through the displayed records, I get IndexOutOfRange exception in the ValidateIndex method of InfragisticsWPF4.v16.1.dll.
Here is the full stack trace:
------
InfragisticsWPF4.v16.1.dll!Infragistics.Collections.SparseArray.ValidateIndex(int index = 19893) Line 2297 C# InfragisticsWPF4.v16.1.dll!Infragistics.Collections.SparseArray.SetItemHelper(int index = 19893, object item = {Infragistics.Windows.DataPresenter.DataRecord}, bool performingAdd = false) Line 2195 C# InfragisticsWPF4.v16.1.dll!Infragistics.Collections.SparseArray.this[int].set(int index = 19893, object value = {Infragistics.Windows.DataPresenter.DataRecord}) Line 2317 C# InfragisticsWPF4.DataPresenter.v16.1.dll!Infragistics.Windows.DataPresenter.DataRecordsSynchronizer.Process_CollectionChangedWhenAsyncResetPending(object sender = Count = 19894, System.Collections.Specialized.NotifyCollectionChangedEventArgs e = {System.Collections.Specialized.NotifyCollectionChangedEventArgs}) Line 121 C# InfragisticsWPF4.DataPresenter.v16.1.dll!Infragistics.Windows.DataPresenter.ListSynchronizer<object,Infragistics.Windows.DataPresenter.DataRecord>.OnSource_CollectionChanged(object sender = Count = 19894, System.Collections.Specialized.NotifyCollectionChangedEventArgs e = {System.Collections.Specialized.NotifyCollectionChangedEventArgs}) Line 232 C#> System.dll!System.Collections.ObjectModel.ReadOnlyObservableCollection<System.__Canon>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Unknown System.dll!System.Collections.ObjectModel.ReadOnlyObservableCollection<System.__Canon>.HandleCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Unknown System.dll!System.Collections.ObjectModel.ObservableCollection<object>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Unknown System.dll!System.Collections.ObjectModel.ObservableCollection<System.__Canon>.InsertItem(int index, System.__Canon item) Unknown mscorlib.dll!System.Collections.ObjectModel.Collection<object>.Add(object item) Unknown PresentationFramework.dll!MS.Internal.Data.CollectionViewGroupInternal.Add(object item) Unknown PresentationFramework.dll!MS.Internal.Data.CollectionViewGroupRoot.AddToSubgroups(object item, MS.Internal.Data.LiveShapingItem lsi, MS.Internal.Data.CollectionViewGroupInternal group, int level, bool loading) Unknown PresentationFramework.dll!MS.Internal.Data.CollectionViewGroupRoot.AddToSubgroup(object item, MS.Internal.Data.LiveShapingItem lsi, MS.Internal.Data.CollectionViewGroupInternal group, int level, object name, bool loading) Unknown PresentationFramework.dll!MS.Internal.Data.CollectionViewGroupRoot.AddToSubgroups(object item, MS.Internal.Data.LiveShapingItem lsi, MS.Internal.Data.CollectionViewGroupInternal group, int level, bool loading) Unknown PresentationFramework.dll!System.Windows.Data.ListCollectionView.PrepareGroups() Unknown PresentationFramework.dll!System.Windows.Data.ListCollectionView.PrepareLocalArray() Unknown PresentationFramework.dll!System.Windows.Data.ListCollectionView.RefreshOverride() Unknown PresentationFramework.dll!System.Windows.Data.CollectionView.RefreshInternal() Unknown PresentationFramework.dll!System.Windows.Data.CollectionView.Refresh() Unknown ------
Moreover, grid's filters work very unstable. Sometimes, they stop working after several filtrations.
Any solution to that problem will be highly appreciated!
Hello Oleg,
Thank you for reaching out. I will be working on a sample to isolate this issue in order to resolve it. To help us resolve this quicker please send us an isolated sample project where this is reproduced so I can investigate it further for you. I'd greatly appreciate it.
Let me know if you have any additional questions regarding this matter.
Sincerely,
Michael Di FilippoAssociate Software DeveloperInfragistics, Inc.www.infragistics.com/support
Hi, Michael!
Thank you for the answer.
Here is the the isolated sample project where that problem is reproduced.
Steps to reproduce: