DataGrid
event handling bug.
#4969
Labels
bug 🐛
An unexpected issue that highlights incorrect behavior
DataGrid 🔠
Issues on DataGrid control
needs attention 👋
needs triage 🔍
Describe the bug
When
DataGrid
handles a remove event when resort happens, it gets the removed item from the sender:However, since the item is already removed from the sender, it will get the wrong item. This can be verified by the source of
AdvancedCollectionView
Particularly, if an item is removed from the end, the index will be out of the bound of the source list, thus an
ArgumentOutOfRangeException
will be thrown by theAdvancedCollectionView
, with such stack trace:Regression
No response
Reproducible in sample app?
Steps to reproduce
Expected behavior
The
DataGrid
should get the right removed item when handling event.Screenshots
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
No response
Device form factor
Desktop
Nuget packages
communitytoolkit.winui.ui.controls 7.1.2
communitytoolkit.winui.ui.controls.datagrid 7.1.2
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item.
The text was updated successfully, but these errors were encountered: