Skip to content

Specify whether a child node has children when the TreeListView does not fetch sub-level nodes.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/wpf-tree-list-control-expand-buttons-when-sub-level-children-are-not-fetched

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Specify whether a child node has children when the TreeListView does not fetch sub-level nodes.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •