Skip to content

AdvancedCollectionView ArgumentOutOfRangeException when remove the last element #4263

@Dimigergo

Description

@Dimigergo

Describe the bug

When I use an AdvancedCollectionView and remove the last element from the bound collection the following exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll Index was out of range. Must be non - negative and less than the size of the collection.

  • Is this bug a regression in the toolkit?

Steps to Reproduce

  • Can this be reproduced in the Sample App?

Steps to reproduce the behavior:

  1. AdvancedCollectionView.zip
  2. Start application
  3. Click on 'Delete last'
  4. See error in message box.

Expected behavior

The last element should be deleted without error.

Environment

NuGet Package(s):
Package Version(s):

    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
      <Version>6.2.12</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp">
      <Version>7.1.0-rc2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI">
      <Version>7.1.0-rc2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
      <Version>7.1.0-rc2</Version>
    </PackageReference>

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build ({build_number})

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build ({build_number})

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio version:

  • 2017 (15.{minor_version})
  • 2019 (16.11.3)
  • 2022 (17.{minor_version})

Metadata

Metadata

Assignees

No one assigned

    Labels

    DataGrid 🔠Issues on DataGrid controlIn-PR 🚀bug 🐛An unexpected issue that highlights incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions