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
The hasChildrenSelector in HierarchicalExpanderColumn is only evaluated once. This means that, if the children collection is modified, the selector should be re-evaluated.
Run it and you will see how the 2 TreeDataGrids behave differently even though they're using the same tree (same nodes).
TreeDataGridExpandBug_jY7ER5C7s0.mp4
Please, notice that if you run the sample and click the expand button before the root has any children, it won't be expandable either!
Manual repro:
In case you want to warm up your hands, you can create your own repro with the steps below:
Inside a ViewModel's constructor, create a TreeDataGrid with a root node and let its children be inside an ObservableCollection.
Create a Source of type HierarchicalTreeDataGridSource.
Create a HierarchicalExpanderColumn where the hasChildSelector is set to node.Children.Any(). Put a breakpoint inside this lambda expression.
Don't add any children in the root node.
Put code that will add children to the collection AFTER the TreeDataGrid is displayed on the screen. For example, a Button that will add children when clicked.
Result: If you add children after the TreeDataGrid is initialized and shown, the breakpoint won't be hit, and the root node will never be expandable (the little expander won't show)
Expected: The breakpoint should be hit and the "has children" condition should be re-evaluated.
The text was updated successfully, but these errors were encountered:
The
hasChildrenSelector
inHierarchicalExpanderColumn
is only evaluated once. This means that, if the children collection is modified, the selector should be re-evaluated.Repro
I've prepared a minimal repro HERE.
Run it and you will see how the 2 TreeDataGrids behave differently even though they're using the same tree (same nodes).
TreeDataGridExpandBug_jY7ER5C7s0.mp4
Please, notice that if you run the sample and click the expand button before the root has any children, it won't be expandable either!
Manual repro:
In case you want to warm up your hands, you can create your own repro with the steps below:
ObservableCollection
.HierarchicalTreeDataGridSource
.HierarchicalExpanderColumn
where thehasChildSelector
is set tonode.Children.Any()
. Put a breakpoint inside this lambda expression.Result: If you add children after the TreeDataGrid is initialized and shown, the breakpoint won't be hit, and the root node will never be expandable (the little expander won't show)
Expected: The breakpoint should be hit and the "has children" condition should be re-evaluated.
The text was updated successfully, but these errors were encountered: