ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeView control
  • Overview
  • Examples
  • Example 1
  • Example 2
  • Example 3
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
WINDEV Data binding is available on the TreeView controls: the control can be directly linked to a data file or variable. For more details, see TreeView control linked to a variable or data file.
By default, the TreeView control cannot automatically display the data coming from a data file.
Let's see some examples used to perform this operation.
This algorithm is used to populate a Treeview control from a data file:
// Browsing the data file
HReadFirst(FileName, KeyName)
WHILE HOut() = False
// Add to the TreeView control
TreeAdd(TREE_TreeViewControlName, MyRoot + TAB + Branch + TAB + Leaf)
HReadNext(FileName, KeyName)
END
Examples

Example 1

// Browsing the data file
HReadFirst(Company, City)
WHILE HOut() = False
// Add to the TreeView control
TreeAdd(TREE_TreeViewControlName, Company.City + TAB + Company.CompanyName)
HReadNext(Company, City)
END

Example 2

// Browsing the data file
HReadFirst(Customer, CustName)
WHILE HOut() = False
// Add to the TreeView control
TreeAdd(TREE_TreeViewControlName, Left(Customer.CustName, 1) + TAB + Customer.CustName)
HReadNext(Customer, CustName)
END

Example 3

// Browsing the data file
FOR EACH Customer ON CustName
// Add to the TreeView control
TreeAdd(TREE_TreeViewControlName, Left(Customer.CustName, 1) + TAB + Customer.CustName)
END
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help