AdvancedCollectionView ArgumentOutOfRangeException fixed, or at least improved
Fixes
PR Type
What kind of change does this PR introduce?
- Bugfix
What is the current behavior?
AdvancedCollectionView crashes with ArgumentOutOfRangeException with live shaping (filtering).
What is the new behavior?
One less crash.
PR Checklist
Please check if your PR fulfills the following requirements:
- [X] Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
- [X] Based off latest main branch of toolkit (specifically, the
winuibranch) - [X] Tested code with current supported SDKs
- [ ] New component
- [ ] Pull Request has been submitted to the documentation repository instructions. Link:
- [ ] Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
- [ ] If control, added to Visual Studio Design project
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
- [ ] Icon has been created (if new sample) following the Thumbnail Style Guide and templates
- [ ] New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run build/UpdateHeaders.bat)
- [X] Contains NO breaking changes
Other information
Closes #4813
Thanks myblindy for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌
Hi @myblindy, thanks for opening up a PR. Can you add a few test cases which exercise this scenario and show the fix resolves the issue without impacting current behavior?
We're also working off of our main branch currently, so it'd be best to have this fix in there before we start migrating code for our next major release. Thanks.
No can do, sorry, the main branch doesn't compile at all. Entire projects don't even load and request updates to VS (I'm using 2022 17.5), including the test projects, and if I click on "download update" it just opens a blank bing.com page.

For now I just copied the collection view .cs files into my project and fixed them there and that works fine, so that brings me up to functional levels. Far from elegant, but my own code does compile and the fix works so I'm good for now I suppose.