You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the debugger, stepping through my filter function, I can see that it has the intended amount of elements, yet the view does not render the correct amount.
To Reproduce
Create a DataGrid bound to an ObservableCollection, apply a filter operation on said list, see the view not updating the rows correctly.
Expected behavior
The DataGrid should respond correctly to filters/insertions on said list, and show the correct amount of rows.
For further context: I implemented the same mechanic using ItemsControl and ItemsControl.ItemTemplate and executed the program (keeping the DataGrid impl for double checking) and in that case only the ItemsControl impl responds as intended.
The text was updated successfully, but these errors were encountered:
Ideally, you shouldn't recreate input collection, but instead modify it. Removing filtered out items, adding new items. Or at least a combination of Clear+AddRange. "Observable" part of the ObservableCollection isn't utilized in your code.
DynamicData library can also help with filtering scenario.
But other than that, your code should also work, seems like a bug.
Describe the bug
I have a
DataGrid
as follows:It is then bound to an
ObservableCollection
that I filter via the following binding:In the debugger, stepping through my filter function, I can see that it has the intended amount of elements, yet the view does not render the correct amount.
To Reproduce
Create a
DataGrid
bound to anObservableCollection
, apply a filter operation on said list, see the view not updating the rows correctly.Expected behavior
The
DataGrid
should respond correctly to filters/insertions on said list, and show the correct amount of rows.Avalonia version
11.0.10
OS
Linux
Additional context
Code related to said
DataGrid
:Example of list not returning to original state:
https://github.com/AvaloniaUI/Avalonia/assets/52252627/19e46003-88aa-4c74-b685-c401f28e9300
For further context: I implemented the same mechanic using
ItemsControl
andItemsControl.ItemTemplate
and executed the program (keeping theDataGrid
impl for double checking) and in that case only theItemsControl
impl responds as intended.The text was updated successfully, but these errors were encountered: