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

Details

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 ValueDescription
NoHide the expand/collapse image. The item cannot be expanded.
UnknownShow the expand/collapse image. The item can be expanded.
YesShow the expand/collapse image. The item can be expanded.

Example

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)
 
      #Com_owner.LoadBranch
 
   When (= Yes)
 
      #List.CurrentItem.DeleteAll
      #Com_owner.LoadBranch
 
   Endcase
 
Endroutine

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2