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 / Table control / Data-bound Table
  • Overview
  • Table control linked to a data file with automatic browsing
  • data-bound Table control updated programmatically
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Linking a Table control to a data file or query
ODBCNot available with this kind of connection
Overview
A Table control can be used to display the contents of a data file or query: a user can select one or more records from the data file or query.
A Table control can be linked to:
  • an existing query Simply select this query from the list of queries in your project.
  • a query integrated with the Table control This query will be created in the Table control creation wizard. This query will be available for this control only.
When a Table control is linked to a data file (or a query), the Table control can be initialized with the contents of the data file:
  • or automatically No specific code is required to initialize the Table control field. The options to loop through the data file linked to the control can be defined in the "Content" tab of the Table control description.
  • or by programming It is necessary to enter the path code of the data file linked to the Table control in the various Table control events. This method is not recommended.
    AndroidiPhone/iPad This method is not available.
Note When creating a Table control, the wizard asks for the information needed to link the field to a data file (or query).
For details of how to manage Table control fields linked to a query, see Table fields linked to a query.
Table control linked to a data file with automatic browsing
A data-bound Table control displays data from a specific data source (data file, query, etc.).
The content of the Table control is defined when it is created and can be modified in the description window ("Content" tab).
In this window, you can define whether the Table control is bound to a data file or is populated programmatically. For a data-bound Table control, you can define how to loop through the data source:
  • Browsed data file
File or query containing the data to display.
If the Table control is based on an embedded query, the name of the browsed file has the following format: <Window Name>_<Number>$Query. In this case, all the options of the "Embedded query" button are available.
  • Stored item (optional)
Item whose value is returned to the program when a row is selected in the Table control.
  • Automatic iteration
If this option is checked, the runtime engine iterates over the file and displays the data in the Table control. No WLanguage code is required.
  • Search item
Item used to loop through the data source. The records displayed in the Table control are sorted based on this item.
If <Automatic> is selected, the HFSQL engine automatically selects the best search key.
  • Reverse course (descending)
The iteration direction depends on the browse item. The iteration direction is defined in the data model editor, in the characteristics of the item.
If this option is checked, the iteration direction used will be the opposite of the one defined in the data model editor.
  • Display records whose browse item begins with
Condition used to filter the displayed records. This is a "Start with" filter and is applied to the browse item. To implement more complex filters, use HFilter. For more details on filters, see Filter in data-bound Table controls.
Android Filter options are not available for Table controls with direct access to the data source.
WINDEV Display the content while moving the scrollbar
If this option is checked, the size of the vertical scrollbar cursor will be proportional to the number of elements in the Table control.
WINDEVWINDEV Mobile Use the HFilter function to browse the data file
Allows you to filter the records displayed in the Table control and the base data file of the control. For more details on this option, see Filter in data-bound Table controls.
Android Filter options are not available for Table controls with direct access to the data source.
WINDEV Synchronize the display (HFSQL C/S)
This option automatically refreshes the data-bound Table control as soon as the associated Client/Server HFSQL data file is modified.
WINDEV Display a [ + ] to see the details of a row
This option allows you to expand a row in the Table control to see records from other data files that are bound to the selected row.
data-bound Table control updated programmatically
If you use a data-bound Table control with programmed initialization, the code to loop through the data file must be entered in the different events associated with the control. This method is not recommended and is only kept for backward compatibility.
For example Initialization of a Table control with the clients of the CLIENT data file.
// Initialisation du champ Table
HReadFirst(CLIENT, NOM)

// Enregistrement précédent 
HReadPrevious(CLIENT, NOM)
// Enregistrement suivant 
HReadNext(CLIENT, NOM)
// Dernier enregistrement
HReadLast(CLIENT, NOM)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/02/2025

Send a report | Local help