PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
This content comes from an automatic translation.
  • Overview
  • Examples
  • Example 1
  • Example 2
  • Example 3
Products
WINDEVWEBDEV - Server codeWEBDEV - Browser codeWINDEV MobileReports and Queries
Platforms
WindowsLinuxWindows MobileUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadApple Watch
Languages
JavaPHPAjaxUser code (UMC)External language
Databases
HFSQLHFSQL Client/ServerStored proceduresOLE DBODBCNative Accesses
How do I fill a Treeview control from a data file?
Overview
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 fill a Treeview control from a data file:
// Read the file
HReadFirst(FileName, KeyName)
WHILE HOut() = False
// Add into the treeview
TreeAdd(NameTreeViewControl, MyRoot + TAB + Branch + TAB + Leaf)
HReadNext(FileName, KeyName)
END
Examples

Example 1

// Read the file
HReadFirst(Company, City)
WHILE HOut() = False
// Add into the treeview
TreeAdd(TreeViewControl, Company.City + TAB + Company.CompName)
HReadNext(Company, City)
END

Example 2

// Read the file
HReadFirst(Customer, CustName)
WHILE HOut() = False
// Add into the treeview
TreeAdd(TreeViewControl, Left(Customer.CustName, 1) + TAB + Customer.CustName)
HReadNext(Customer, CustName)
END

Example 3

// Read the file
FOR EACH Customer on CustName
// Add into the treeview
TreeAdd(TreeViewControl, Left(Customer.CustName, 1) + TAB + Customer.CustName)
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment