microsoft / microsoft/microsoft-ui-xaml
ListView Fails to Remove Multiple Items with RemoveRange Operation in Bound Collection
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
In a ListView with a bound Collection, the RemoveRange operation does not remove multiple items as intended. Instead of deleting the specified range of items (e.g., from index 0 to 4), only a single item is removed. This issue disrupts the functionality of bulk removal operations in ListView collections.
### Steps to reproduce the bug
- Run the attached sample application - [ListViewTestSample.zip](https://github.com/user-attachments/files/18134450/ListViewTestSample.zip).
- Click the "Remove" button in the view.
- Observe that the ListView does not remove the specified range of items.
### Expected behavior
Upon clicking the "Remove" button:
- Five items (indices 0 through 4) should be removed from the collection.
- The ListView should update accordingly to reflect the removal of these five items simultaneously.
### Screenshots
**Before Button Click :**

**After Button Click :**

### NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
### Windows version
Windows 11 (23H2): Build 22631
### Additional context
_No response_
Contributor guide
Research direction
Run the attached ListViewTestSample.zip and reproduce the RemoveRange action from the view's Remove button. Trace the bound Collection change handling and verify that removing indices 0 through 4 produces five removals and updates the ListView accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100