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
Hi there,
I observed an issue when updating properties in the model. I hope it's not a mishandling from my side, but I think it's a bug.
Setup:
I've got a model which has a property Size, which for Folders is the sum of all children sizes. I have a TreeDataGrid that has a column showing the size, AutoDragDrop enabled, with Items only being allowed to be dropped on Folders. The TreeDataGrid also shows another int column. Each time the ObservableCollection containing the children fires a CollectionChanged, a RaisePropertyChanged(nameof(Size)) is called.
Action:
I move items around.
Expected behavior:
The value in the Size column changed every time I move an item around.
Observed behavior:
The value in the Size column changes every second time. (Depending on the number of int columns less often).
In the following gif you can observe the behavior. Left hand side is the described behavior, right hand side as I would expect it. Only difference is the int column.
I tried to use a string text column with x => x.Prop.ToString(), but I get an exception: System.ArgumentException Expression of type 'System.Int32' cannot be used for return type 'System.Object'
This issues apparently not only appears when there are two int columns, but also for two string columns. Not sure what the exact condition is though, but when I have a table with only two strings and update the second one, it only works every second time.
My workaround: Fire the PropertyChanged event twice. Ugly, but working.
Hi there,
I observed an issue when updating properties in the model. I hope it's not a mishandling from my side, but I think it's a bug.
Setup:
I've got a model which has a property
Size
, which forFolder
s is the sum of all children sizes. I have aTreeDataGrid
that has a column showing the size,AutoDragDrop
enabled, withItems
only being allowed to be dropped onFolders
. The TreeDataGrid also shows another int column. Each time theObservableCollection
containing the children fires aCollectionChanged
, aRaisePropertyChanged(nameof(Size))
is called.Action:
I move items around.
Expected behavior:
The value in the Size column changed every time I move an item around.
Observed behavior:
The value in the Size column changes every second time. (Depending on the number of int columns less often).
In the following gif you can observe the behavior. Left hand side is the described behavior, right hand side as I would expect it. Only difference is the int column.
I tried to use a string text column with x => x.Prop.ToString(), but I get an exception: System.ArgumentException
Expression of type 'System.Int32' cannot be used for return type 'System.Object'
Here's the code: https://github.com/blackmole/AvaloniaTreeDataGridValueUpdate
The text was updated successfully, but these errors were encountered: