Data-virtualization in a treelistview

Grids for WPF Forum

Posted 2 months ago by David jonsson
Version: 24.1.4
Avatar

Hi!

I have some questions for my treelistview. I switched datavirtualization on and made some changes to itemadapter etc. It mostly works great, but I experience some issues which someone probably has an answer to.

I changed to "ChildrenQueryModeDefault = TreeItemChildrenQueryMode.OnExpansion" on the itemadapter since I think this was needed for datavirtualization to work properly. I have implemented all the "CanHaveChildren, GetChildren, SetIsExpanded, GetIsExpanded" etc.

1. I have a "Expand all" button which expands all nodes and its children all the way to the leafs. This now only expands the first level of children. It shows the second level items as "expandable" with an arrow and I can manually expand them. I understand this probably have with some timing issue with the new query-mode. How do you work around this?

2. selecting a leaf-item from other parts of the application should expand the entire path in the treelistview. This is done by settings "IsExpanded" from the leaf all the way up to the first-level item. This also only expands the first level with the difference that the second-level items has no expansion-arrow looking like they dont have any children.

3. I have a datafilter connected to this tree. Returning "DataFilterResult.IncludedByDescendants" does not work here so I have to "spoof" it by saying that items not passing the filter but having children that does gets "DataFilterResult.Included"

Any pointers to how I can fix these or if you need any more information?

EDIT: I get it to sometimes work if I for instance want to expand all the way to a leaf by setting the isexpanded bottom-up instead of top-down. But then a visual issue exists in that the IsSelected property is not visualized correctly (the node have IsSelected set correctly)

EDIT2: Scenario of selecting a leaf from viewmodel and expanding all the way down to the leaf in a collapsed starting point. If I set the IsSelected property first on the leaf, then expand all the nodes from the leaf up to the root node (not vice-versa) I get it to work 98 % of the time... But sometimes the selection visual is not updated properly.

[Modified 2 months ago]

Comments (1)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi David,

Thank you for the detailed information. We were able to reproduce the behavior when data virtualization was enabled and child items were queried on expansion.

We found that virtual placeholder nodes were not always resolved early enough during expansion, selection, and filtering. This could cause ExpandAll to stop after one level, prevent a deeply nested item from being selected through SelectedItem, and prevent IncludedByDescendants filtering from displaying the path to a matching descendant.

We have updated the control to handle those virtual nodes correctly. Our tests now show the entire hierarchy expanding, deeply nested items being selected correctly, and IncludedByDescendants filtering displaying the expected path. Returning Included should no longer be necessary as a workaround after these changes.

We are very close to releasing v26.1, and the updates will be included in that version.


Actipro Software Support

The latest build of this product (v26.1.0) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.