Help / WLanguage / WLanguage functions / Controls, pages and windows / TreeView functions
  • Node to collapse
  • Selection bar
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Collapses a branch previously expanded (as well as its child elements):
  • The "child" nodes are no longer visible in the TreeView control.
  • The child nodes are collapsed.
Example of TreeView control:
Vocabulary linked to a TreeView control
Reminder: At runtime, a node is collapsed when the node name is preceded by "+".
// Collapse the "Desserts" node in the "TREE_TVRecipe" TreeView control
Res = TreeCollapseAll(TREE_TVRecipe, "Recipes" + TAB + "Desserts")
<Result> = TreeCollapseAll(<TreeView control> [, <Node to collapse>])
<Result>: Boolean
  • True if the node and its children have been collapsed,
  • False otherwise.
<TreeView control>: Control name
Name of the TreeView control to be used.
<Node to collapse>: Optional character string
Path of the node to collapse. This parameter has the following format:
"<Root name>" + TAB + ["<Name of 1st node>" + TAB + ...
["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>"
If this parameter is not specified, the TreeView control is collapsed from the root.
If there are two elements with the same name in the path, you can add the IDs of the elements (after their names using TreeID).

Node to collapse

If the node to collapse:
  • is not found, TreeCollapseAll returns False.
  • is not specified, TreeCollapseAll returns True. The TreeView control is collapsed from its root.
  • is a leaf, TreeCollapseAll returns True.
  • is already collapsed, TreeCollapseAll returns True.

Selection bar

  • If the selection bar was positioned on one of the elements of the node to collapse, it is positioned on the collapsed node after the call to TreeCollapseAll.
  • The modification code is called whenever the selection bar is moved. If two levels are collapsed and if the selection bar is positioned on the higher node, the modification codes of each level are run.
  • The full path of the selected element is returned by TreeSelect.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help