You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
AdvancedCollectionView throws ArgumentOutOfRangeException when live shaping set to true. #4339
AdvancedCollectionView throws ArgumentOutOfRangeException when live shaping set to true and try to change values of filter properties.
Steps to Reproduce
I've created a test app to reproduce this issue. The app contains two lists each of lists items source is bound to filtered advanced collection view source. To reproduce this issue drag & drop first item from list1 to list2 and then drag & drop fifth item from list 1 to list 2, you will notice the exception.
The AdvancedCollectionView operates just fine, when I run a scenario test like this in our UnitTests.UWP project, with everything the same except for emulating drag and drop (i.e., to simulate drag & drop, I just simply removed a Model item from one AdvancedCollectionView and added it to another AdvancedCollectionView).
For this particular issue, there may be more Drag & Drop settings that need to be explored.
This issue is actually not related to drag & drop. In test case I just used drag & drop to update a property of model.
and the property "Year" is responsible for the filter.
So the real problem in this case is with collection filtered items handling and it occurred in AddvancedCollectionView.cs at line 702 where it tries to compare items from source and view to get index for new item.
Activity
XAML-Knight commentedon Oct 25, 2021
The AdvancedCollectionView operates just fine, when I run a scenario test like this in our UnitTests.UWP project, with everything the same except for emulating drag and drop (i.e., to simulate drag & drop, I just simply removed a Model item from one AdvancedCollectionView and added it to another AdvancedCollectionView).
For this particular issue, there may be more Drag & Drop settings that need to be explored.
w-ahmad commentedon Oct 26, 2021
This issue is actually not related to drag & drop. In test case I just used drag & drop to update a property of model.

and the property "Year" is responsible for the filter.

So the real problem in this case is with collection filtered items handling and it occurred in AddvancedCollectionView.cs at line 702 where it tries to compare items from source and view to get index for new item.
WindowsCommunityToolkit/Microsoft.Toolkit.Uwp.UI/AdvancedCollectionView/AdvancedCollectionView.cs
Line 702 in 44ad0cc
michael-hawker commentedon Oct 26, 2021
May be related to #4263 and #2913 as well?
w-ahmad commentedon Oct 26, 2021
I don't think so... cause these are related to handle removed item but here's the problem is in handle new items.
XAML-Knight commentedon Oct 26, 2021
For those interested, I also implemented a unit test (in a similar manner) for removing the last item in an ACV, and the test ran fine
michael-hawker commentedon Oct 26, 2021
Thanks @XAML-Knight, did you want to open a PR so we can have that added to the existing test suite?