.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
When using a CollectionView where the ItemSource is set to a binding of type ObservableCollection, and IsGrouped is set to True, the app crashes if the ObservableCollection is updated such that: there are more than 2 items in the first group, or there is more than 1 item in any subsequent group.
1. Download the repo linked above: https://github.com/megukaphii/GroupedCollectionViewBug
2. Run the project on Windows and click the "Load Animals" button
3. Note that the program does not crash with only 1 animal in the second "Monkeys" group, and that it does crash if you subsequently add a third animal to the "Bears" group
Describe the bug
When using a CollectionView where the ItemSource is set to a binding of type ObservableCollection, and IsGrouped is set to True, the app crashes if the ObservableCollection is updated such that: there are more than 2 items in the first group, or there is more than 1 item in any subsequent group.
I tested this by copy+pasting from Microsoft's official CollectionView grouping docs in a brand new project: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/collectionview/grouping Please find said project here: https://github.com/megukaphii/GroupedCollectionViewBug
Regression
No response
Steps to reproduce
Expected behavior
The app does not crash.
Screenshots
No response
IDE and version
Rider
IDE version
RD-233.11361.12
Nuget packages
Nuget package version(s)
8.2.2
Additional context
No response
Help us help you
No, just wanted to report this