Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListView Fails to Remove Multiple Items with RemoveRange Operation in Bound Collection #10235

Open
prakashKannanSf3972 opened this issue Dec 14, 2024 · 1 comment
Labels
area-Lists ListView, GridView, ListBox, etc bug Something isn't working

Comments

@prakashKannanSf3972
Copy link

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.

  • 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 :

Image

After Button Click :

Image

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

@prakashKannanSf3972 prakashKannanSf3972 added the bug Something isn't working label Dec 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 14, 2024
@castorix
Copy link

It works for me (Windows 10 22H2, Windows App SDK 1.6.241114003)
if I do instead :
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));

@karkarl karkarl added area-Lists ListView, GridView, ListBox, etc and removed needs-triage Issue needs to be triaged by the area owners labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Lists ListView, GridView, ListBox, etc bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants