ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeView Table control
  • Overview
  • How to?
  • Create a TreeView Table control based on a data file
  • Create a hierarchical TreeView Table control based on a data file
  • Define TreeView Table control sources (control description window)
  • Define the links between the various columns of a TreeView Table control based on a data file
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
TreeView Table control based on a data file
Overview
A TreeView Table control can be linked to a data file or a query. In this case, the field can only be linked to a data file or a query loaded in memory.
How to?
WINDEViPhone/iPad

Create a TreeView Table control based on a data file

To create a hierarchical TreeView Table control based on a data file:
  1. On the "Creation" tab, in the "Data" group, expand "Table and List Box" and select "TreeView Table".
  2. Click at the desired location to create the control.
  3. Go to the "Content" tab of the TreeView Table control description window.
    Content tab of the TreeView Table control
    This tab is used to define the various sources of the TreeView Table control. In fact, a TreeView Table control can be linked to different sources, enabling nested records to be displayed.
    Select the "Data file/Survey" filling mode.
  4. If necessary, define the bindings of the different columns of the TreeView Table control.
WINDEV "Delayed fill of sub-levels (faster)" option
When a TreeView Table control linked to a data file has many elements and sub-elements, it can take a long time to fill in all the elements.
The "Delayed fill of sub-levels (faster)" option populates each sub-level only when the user expands a level. The population time is optimized and it takes less time to populate the control the first time.
Note To use this option on a programmatically populated TreeView Table control, use the AddChildDelayed property.
WEBDEV - Server code

Create a hierarchical TreeView Table control based on a data file

To create a hierarchical TreeView Table control based on a data file:
  1. On the "Creation" tab, in the "Data" group, expand "Table and List Box" and select "TreeView Table".
  2. The TreeView Table control creation wizard opens.
  3. In the wizard, select "Display data from a data file or existing query". Go to the next step.
  4. Define the different data sources of the TreeView Table control. In fact, a TreeView Table control can be linked to different sources, enabling nested records to be displayed.
    Data sources of the tree structure (control creation wizard)
Note: If you leave this information blank in the wizard, it can be modified in the "Content" tab of the.

Define TreeView Table control sources (control description window)

To define the data source of the TreeView Table control:
  1. Open the control description window.
  2. In the "Content" tab, select the "Data file/Survey" fill if necessary.
  3. Click "Add". A "<None>" data source is automatically added.
  4. Define the characteristics of this source:
    • Source: corresponds to the data file or query to be browsed.
    • Route: corresponds to the route key used to browse the source.
    • Displayed: corresponds to the field displayed in the first column of the TreeView Table control field.
      WEBDEV - Server code Note: For each level, it is possible to customize the rolled and unrolled image displayed..
  5. If necessary, define the source of the link of the previous level. For example, if the first level loops through the Customer data file, the second one can loop through the Orders data file. The items that will be used to set the relation are "Customer.CustomerID" and "Orders.CustomerID". By default, the source of the link is automatically deduced from the items and links defined in the analysis.
  6. Define as many sources as necessary.
The first column of the TreeView Table control displays the data from the selected sources.
Special case: hierarchical TableView Table control based on a recursive data file
A hierarchical Table field can display records dependent on the previous record (a classic case of a recursive link allowing, for example, to manage parents/children)
Example of recursive TreeView Table control
To manage this type of TreeView Table control, you can define a reflexive link in the "Contents" tab of the control description window.
The "root" rows are associated with a record for which the bound item corresponds to 0 or empty (according to the type of item).

Define the links between the various columns of a TreeView Table control based on a data file

By default, the first column of the TreeView Table control (the column representing the hierarchy) displays the items indicated in the sources ("Content" tab, "Displayed" value of the various sources).
The TreeView Table control can also display other data in its other columns.
To define the bindings of the different columns:
  1. If necessary, create a new column ("New" in the description window of the TreeView Table control) or select an existing column.
  2. Go to the "Binding" tab and define the desired data binding. The binding can be:
    • single data file In this case, the data binding concerns one of the TreeView Table control's source data files.
      If one of the records displayed in the TreeView Table control is modified, the changes reflect automatically in the associated data file.
    • multiple data files In this case, the data binding can be performed with one of the data files linked to one of the source data files.
      If one of the records displayed in the TreeView Table control is modified, the changes do not reflect automatically in the associated data file. It must be managed programmatically.
  3. Validate.
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/26/2025

Send a report | Local help