This example demonstrates how to specify whether a child node has children (and should display the expand button) when the TreeListView does not fetch sub-level nodes.
The TreeListView
in hierarchical binding mode fetches child nodes of sub-level nodes when you expand their parent node. Such behavior is designed to determine whether to display expand buttons. You can set the TreeListView.FetchSublevelChildrenOnExpand property to false
to keep sub-level children unfetched. In this case, all child nodes display expand buttons (even if they do not have children). The expand button is hidden when you expand a node that does not contain child nodes:
Follow the steps below to prevent this behavior:
- Your data source objects should contain a field that specifies whether an item has children.
- Assign the field name to the TreeListView.HasChildNodesPath property to display expand buttons only when required.
As a result, the TreeListView
does not fetch sub-level children to determine whether to display expand buttons:
- Expand and Collapse Nodes
- TreeListView.HasChildNodesPath
- TreeListView.FetchSublevelChildrenOnExpand
- Bind to Hierarchical Data Structure
- WPF Tree List - Control Whether to Create Child Nodes
- WPF Tree List - Implement the Child Nodes Path
- WPF Tree List - Load Nodes Asynchronously Without Locking the Application's UI
(you will be redirected to DevExpress.com to submit your response)