Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 4.07 KB

File metadata and controls

48 lines (32 loc) · 4.07 KB

WPF Tree List - Control Visibility of Expand Buttons when Sub-level Children are not Fetched

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:

image

Follow the steps below to prevent this behavior:

  1. Your data source objects should contain a field that specifies whether an item has children.
  2. 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:

image

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)