Tree View Item - HasChildren Property

Controls the appearance of the expand and collapse image for the item

Member of Tree View Item (PRIM_TVIT)

Data Type - Enumeration


The HasChildren property is used to control the appearance of the expand/collapse image for an item.
By default the control will show the correct icon for an item. If there are no child items, no expand image will be shown.
When building trees on demand it is necessary to show the expand item even though there are no child items yet. This means that the item can expand, and the HasChildren can be tested to see whether there is a need to load the branch.

Allowed Values

Enum Value Description
No Hide the expand/collapse image. The item cannot be expanded.
Unknown Show the expand/collapse image. The item can be expanded.
Yes Show the expand/collapse image. The item can be expanded.


In this example of how you might handle dynamically loading a tree, if there are already child items for an expanding item, they are deleted and the branch reloaded.
Evtroutine Handling(#List.ItemExpanding)
   Case (#List.CurrentItem.HasChildren)
   When (= Unknown)
   When (= Yes)

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020