Hello,
I have an non fatal exception, when I have this the filter does not work, the message is : "Collection was modified; enumeration operation may not execute". This exception is not fatal, the application does not crash, but whenever I have this, the filters that I apply doesn't work(The Filter is a check box on a text field which has 3 different values for about 10000 Dtos, then I do a SaveCustomization of FlatDataSource, change the ItemsSource of the FlatDataSource, and then do a LoadCustimization, that's where I have the exception mentioned above). I have attached the exception and the Stack Trace on the attachment, can you please urgently look into this? Thank you very much.
Regards
Excuse me, the total amount of Dtos for the FlatDataSource is about 50000
Hello pebg,
Thank you for your post.
I have been investigating into this issue to see if there is a known exception of this type, but I can't seem to find one in our internal tracking systems. From the stack trace, it appears that this issue is coming from the 15.1 version of the XamPivotGrid and in the FlatFilterMember.OnSelectionChangeCommitted() method, but other than that, I can't be sure exactly what would cause this InvalidOperationException on your end.
From the stack trace, I am also seeing a BackgroundWorker.DoWork call, and this appears to be happening just prior to the filter-related evaluations, which leads me to wonder whether or not some of these operations on your end are happening asynchronously?
Would it be possible for you to please provide some more information as to exactly what operations are happening when you reproduce this exception? For example, you had mentioned a load customizations call - are you possibly modifying any collections related to the XamPivotGrid during or shortly before/after this call is made? If at all possible, a sample project that reproduces this issue that you are seeing would be extremely helpful as well.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Hi Andrew, Thank you very much for your reply. Exactly when do click on a Refresh button, we will set the ItemsSource of FlatDataSource with a new collection of data, and then do a LoadCustomization to load the filters that we had before: the idea is that when we refresh the data(by setting the ItemsSource of FlatDataSource), we keep the filters that we had before doing so. I will come up with a sample project shortly. Thank you!
Thank you for your response.
It sounds to me like there might be a timing issue between your LoadCustomizations call and the resetting of the ItemsSource, and there might be a conflict between the filters collection of the FlatDataSource happening, but I can't be entirely sure until I can reproduce this issue. I will await your sample on this matter.
Hi Andrew, I'm happy to tell you that this bug is fixed after migrating to the new version 16.2, thank you for your help!
Thank you for your response. I am glad that the 16.2 version resolved this issue for you.
Unfortunately I still have the same issue after migrating to the latest version of WPF(16.2.20162.1006). When I drap 4 columns into the control and try to filter on the first column, it works. But when I click on a Refresh button, which will set the ItemSource collection of FlatDataSource to another, I have lost the filters, here's how we do it:
var layout = this.SaveCustomizations(); ItemsSource = dataSourceItems; this.LoadCustomizations(layout);
So normally after setting the ItemsSource of the FlatDataSource, we do a LoadCustomizations of the layout that we have saved before, but this doesn't work from time to time, especially after I have dragged 4 columns into the control. Can you please look into this? Thank you.