Crash when filtering while data is loading

Hi,

I have an issue with filter in SfDataGrid control:

1. I load asynchronously data to ObservableCollection for real time.
2. I use ObservableCollection to bind a SfDataPager

3. ItemSource of SfDataGrid is binding by:
ItemsSource="{Binding ElementName=sfDataPager, Path=PagedSource}"

4. Each new data in ObservableCollection I update a Label to show how many data is shown:
lblStatus.Text = $"{(MainGrid.View != null ? MainGrid.View.Records.Count.ToString() : "0")} {Process.Write("Of").ToLower()} {(sfDataPager.PagedSource != null ? sfDataPager.PagedSource.GetInternalList().Count.ToString() : "0")} {Process. Write("Data").ToLower()}";

5. I use FilterChanged event from SfDataGrid to update the same Label in the point "4".

6. The problem is when I show popup of filter in SfDataGrid, I do clic in "Ok" and the application crash with the following message:
System.InvalidOperationException: 'Collection was modified; enumeration operation may not executed.'

7. I been testing and the error happends only when data is binding in ObservableCollection.

1 Reply

VS Vijayarasan Sivanandham Syncfusion Team February 15, 2020 04:27 AM UTC

Hi Tomas Raziel Garza Amaya, 
 
We have analyzed your query that “Crash when filtering while data is loading”. We have tried to replicate your scenario, but we are unable to reproduce the reported issue from our end.  
 
Please find the tested sample and video demo from our end in the below link 
 


If still you are facing the same issue, can you please share us below things? 
1.       Code files related to you command  
2.       Brief replication procedure/video illustration of the reported issue 
 
Also, if possible, can you please revert us with the modified sample? It will help us to investigate further and provide appropriate solution at earlier. 
 
Regards, 
Vijayarasan 


Loader.
Up arrow icon