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 Column control
  • Overview
  • How to create a Container column in a Table control?
  • Steps to follow
  • Main control of a Container column
  • Limitations
  • Using a Container column
  • Table control based on a data file or Table control based on a variable
  • Table control populated programmatically
  • Manipulating the controls found in the Container column
  • Limit: Unavailable control types
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
A table cell can contain a set of controls. Several types of controls can be include in a Container column:
  • Static control,
  • edit control,
  • Image control,
  • Button control,
  • WINDEV Chart control,
  • WINDEV Table control,
  • WINDEV Internal Window control,
  • etc.
A main control can be defined for the cell. This control will be the one used:
  • for the additions performed through programming,
  • for the sorts,
  • for the link with the data (link with an item or with a variable), ...
WINDEV Via the internal windows, all the controls of the container column can have a different content for each row of the Table control.
WINDEVWEBDEV - Server code Container columns are also available for hierarchical Table controls s.
New in version 2024
Android table container columns are available for Android applications.
iPhone/iPad table's Container columns are available for iOS applications.
How to create a Container column in a Table control?

Steps to follow

To create a Container column in a Table control:
  1. If necessary, create a Table control (based on a data file, populated programmatically or based on a variable).
  2. Create a Container column (via the popup menu of the Table control or from the description window of the Table control).
  3. Increase (if necessary) the height of the rows found in the Table control with the mouse.
  4. Position the requested controls in the Container cell of the first row found in the Table control. It is possible to:
    • move the existing controls in the window to the Container column.
    • drag and drop the items from the analysis displayed in the "Project explorer" pane.
  5. In the description of the Container column, specify (if necessary) the main control of the column ("General" tab) and validate.

Main control of a Container column

The main control of the Container column corresponds to the control handled by default in the column. For example:
  • The sort of the Container column will be performed on the main control.
  • The searches performed in a Container column will be performed on the main control.
  • Programming additions and modifications: the value of the column specified in TableAddLine for example will be assigned to the main control.
  • Exports made from Table control (exports to Excel, Open Office, Word, etc.) will take into account the value of the column's main control.
  • If the Container column is linked to a data file or to a variable, the control actually linked will be the main control.
The definition of a main control in a Container column is optional.

Limitations

  • WINDEV In Container columns, a string must be assigned to Check Box controls using the following format: "<True/False>;<True/False>;<True/False>...".
    Similarly, the value returned by these Check Box controls is a string in the following format: "<True/False>;<True/False>;<True/False>...".
  • The captions of the options found in the Radio Button and Check Box controls cannot be customized for each row in a Container column.
  • WINDEV To use a control with a different value for each row found in a Container column, all you have to do is include this control in an internal window and insert an Internal Window control into the column. This Tip can be used, for example, for Selector, Switch, etc. fields.
WINDEV Remarks: Internal window, Chart control and Table control in a Container column:
  • Uncheck "Identical content for all the rows" ("UI" tab of the control description window) to get a different display on each row.
  • The controls of the internal window, the Chart controls and the Table controls must be filled through programming.
Using a Container column

Table control based on a data file or Table control based on a variable

A Table control based on a data file can contain one or more Container columns. The controls found in this Container column can display the records of the data file for example.
In this case, the Table control is linked to the data file.
Each control found in the Container column is linked to the corresponding item.
If a main control is defined on the Table control, we advise you to:
  • solution 1: keep the link between the main control and the item found in the data file. The Container column is linked to no item.
  • solution 2: link the Container column to the item associated with the main control and delete the link at control level.
Related Examples:
WD Discover Database Link Discovery examples (WINDEV): WD Discover Database Link
[ + ] This example is a simplified application for managing contacts.

This example explains how to:
- fill a Table control from a data file,
- fill a Looper control from an SQL query,
- create a form.

Table control populated programmatically

A Table control populated programmatically can contain one or more Container columns. The main control of the Container column will be manipulated programmatically by the Table control functions
For example, when a row is added by TableAddLine, only the main control of the column will be assigned with the value defined by the column. If several controls must be initialized in the column, you must use the syntax described in the next paragraph. For example:
NumLigne is int 
NumLigne = TableAddLine(TABLE_Table2, "Moulain")
COL_Colonne1[NumLigne].SAI_Prenom = "Florence"

Manipulating the controls found in the Container column

The controls found in a Container column can be handled via the following syntax:
<Nom de la colonne>[<Numéro de Ligne>].<Nom du champ>
For example:
  • Assigning a value to a control:
    COL_Colonne1[NumLigne].SAI_Prenom = "Florence"
  • Assigning elements to a Combo Box control of a container:
    COL_Colonne1[NumLigne].COMBO_Combo1.Contenu = "Elément 1" + CR + "Elément 2"
  • Modifying a control property:
    COL_Colonne1[NumLigne].PrixHT.Couleur = LightRed
  • Indirection on a control in a Container column:
    sNomChampDansColoneConteneur is string 
    sNomChampDansColoneConteneur = "TABLE_AvecColConteneur.COL_Conteneur[" + ...
    		nIndiceLigne + "].SAI_DansColConteneur"
    //ou
    //sNomChampDansColoneConteneur = "TABLE_AvecColConteneur[" + ...
    // 	nIndiceLigne + "].COL_Conteneur.SAI_DansColConteneur"
    
    Info({sNomChampDansColoneConteneur})
  • WINDEV Adding a row into a Table control found in a Container column:
    TableAddLine(TABLE_AVEC_TABLE_INTEGREE[NumLigne].TABLE_Dans_Conteneur, ...
    		"Contenu_Col1", "Contenu_Col2")
  • WINDEV Handling a Check Box control inserted into an internal window:
    TABLE_SansNom1[NumLigne].FI_SansNom1.INT_Interrupteur[Indice] = True
  • WINDEV Change the internal window in an Internal Window control of a Container column:
    // Charge la fenêtre interne FI_FenêtreInterne1, à la ligne NumLigne d'un champ Fenêtre interne
    // nommé CFI_ChampFenêtreInterne contenu dans une colonne de type conteneur d'un champ Table
    // Attention : le champ CFI_ChampFenêtreInterne doit avoir 
    // l'option "contenu identique pour toutes les lignes" non cochée 
    // (onglet "UI" de la fenêtre de description)
    ChangeSourceWindow(TABLE_SansNom1[NumLigne].CFI_ChampFenêtreInterne, FI_FenêtreInterne1)
Remark: For a Table control based on a data file, the controls of a Container column should be handled in the "Row display" event.
Limit: Unavailable control types
WINDEV In a Container column, all the controls can be used, either directly, or via an internal window.
WEBDEV - Server code In a Container column, only the following types of controls can be used:
  • Rich Text Area control,
  • Simple Static control,
  • Formatted display control,
  • Link control,
  • Button control,
  • Image control,
  • Edit control,
  • Combo Box control,
  • Radio Button control,
  • Check Box control,
  • List Box control,
  • Calendar control,
  • Rating control,
  • Slider control,
  • Bar Code control (not available in browser Table controls),
  • Social Link control (not available in AJAX or Browser Table controls).
  • New in version 2024
    Android In a Container column, the following fields are not supported:
    • Looper control,
    • Dashboard control,
    • Chart control,
    • Scheduler control,
    • Organizer control,
    • Camera control,
    • PDF Reader control,
    • Map control.
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/27/2024

Send a report | Local help