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

Index out of range when filtering the TreeDataGrid #7

Closed
danipen opened this issue Jun 15, 2021 · 1 comment
Closed

Index out of range when filtering the TreeDataGrid #7

danipen opened this issue Jun 15, 2021 · 1 comment

Comments

@danipen
Copy link
Collaborator

danipen commented Jun 15, 2021

When applying a filter and changing the items source, the TreeDataGrid throws an exception because it's accessing an index out of range in the HierarchicalRow.cs, member _rows:

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
  Source=System.Private.CoreLib
  StackTrace:
   at System.ThrowHelper.ThrowArgumentOutOfRange_IndexException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Avalonia.Controls.Models.TreeDataGrid.HierarchicalRows`1.System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Models.TreeDataGrid.IRow>.get_Item(Int32 index) in C:\wks\code\01plastic\test\avalonia-test\Avalonia.Controls.TreeDataGrid\Models\TreeDataGrid\HierarchicalRows.cs:line 36

Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Models.TreeDataGrid.HierarchicalRows<Codice.Utils.ITreeViewNode>.System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Models.TreeDataGrid.IRow>.get_Item(int index) Line 36	Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase<Avalonia.Controls.Models.TreeDataGrid.IRow>.GetRecycledOrCreateElement(int index) Line 332	C# 	
Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase<Avalonia.Controls.Models.TreeDataGrid.IRow>.GetOrCreateElement(int index) Line 306	C# 	
Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase<Avalonia.Controls.Models.TreeDataGrid.IRow>.GenerateElements(Avalonia.Size availableSize, ref Avalonia.Controls.Primitives.TreeDataGridPresenterBase<Avalonia.Controls.Models.TreeDataGrid.IRow>.MeasureViewport viewport) Line 206	C# 	
Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase<Avalonia.Controls.Models.TreeDataGrid.IRow>.MeasureOverride(Avalonia.Size availableSize) Line 177	C#
Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridRowsPresenter.MeasureOverride(Avalonia.Size availableSize) Line 89	C#
[External Code]	
plastic.dll!PlasticAvalonia.Program.Main(string[] args) Line 35	C#

Checkout the following video to get more details about the issue here:
https://www.loom.com/share/b5d3f3dab8e844cda3edcb3725be9e78

@danipen
Copy link
Collaborator Author

danipen commented Jun 16, 2021

Fixed in fa2cfd0

@danipen danipen closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant