PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Handling the duplicate elements in a TreeView control
  • When should I use TreeID?
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Allows you to build the path of the elements found in a TreeView control by differentiating the duplicates. This function can be used in all the functions for handling the elements found in a TreeView control.
Example
ResultTreeView is boolean
ResultTreeView = TreeAdd(TREE_TreeView1, "Root" + TAB + "Leaf", ...
tvDefault, tvDefault, "Id unique leaf")
ResultTreeView = TreeAdd(TREE_TreeView1, "Root" + TAB + "Leaf", ...
tvDefault, tvDefault, "Id unique leaf 2", tvAcceptDuplicate)
// Delete the 2nd duplicate
TreeDelete(TREE_TreeView1, "Root" + TAB + "Leaf" +  ...
TreeID("Unique leaf 2 ID"))
Syntax
<Result> = TreeID(<Identifier>)
<Result>: Character string
Control string that must be added to the name of the element when this element is handled by the functions for treeview management.
<Identifier>: Character string (with quotes)
Identifier of the element. This identifier is used to build the control string of the element. This identifier must be identical to the one used in TreeAdd, TreeInsert or TreeModify.
Remarks

Handling the duplicate elements in a TreeView control

The management of duplicates in the treeviews is based on the management of identifiers. Each section of the path of a treeview element can be associated with an identifier. This association is performed by TreeAdd, TreeInsert or TreeModify.
TreeID is used to handle the duplicate elements via their identifier. To do so, add the control string corresponding to the element of the requested path.
Example:
TreeDelete(TREE_TreeView1, "Root" + TAB + "Leaf" +  ...
TreeID("Unique leaf 2 ID"))
In this example, two "Leaf" elements are found. TreeID was used to identify the one that must be deleted.

When should I use TreeID?

TreeID can be used:
  • in all the syntaxes of the Tree functions, as soon as the path of a duplicate element must be specified.
  • in the following syntax <TreeView Name> [ <Element Path>] that is used to easily handle a treeview element.
The element used is the one whose path and identifier match.
Note: An identifier can be specified for each section of the path of an element.
Related Examples:
The TreeView control Unit examples (WINDEV): The TreeView control
[ + ] Using the TreeView control via the WLanguage Tree functions.
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment