|
|
|
|
|
- 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
- Limitation: Type of fields not available
Container column in a Table control
A table cell can contain a set of controls. Several types of controls can be include in a Container column: - Static Text control,
- edit control,
- Image control,
- Button control,
- etc.
A main control can be defined for the cell. This control will be the one used: - for the additions performed programmatically,
- for the sorts,
- for the link with the data (link with an item or with a variable), ...
How to create a Container column in a Table control? Steps to follow To create a Container column in a Table control: - If necessary, create a Table control (based on a data file, populated programmatically or based on a variable).
- Create a Container column (via the context menu of the Table control or from the description window of the Table control).
- Increase (if necessary) the height of the rows found in the Table control with the mouse.
- 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.
- 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 or modifications: the value of the column indicated in function TableAddLine, for example, will be assigned to the main field.
- Exports made from the Table field (exports to Excel, Open Office, Word, etc.) will take into account the value of the column's main field.
- 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 - The captions of the options found in the Radio Button and Check Box controls cannot be customized for each row in 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 main field bound to the data file item. The Container column is linked to no item.
- solution 2: link the Container column to the field associated with the main field and remove the link at field level.
Related Examples:
|
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"
Info({sNomChampDansColoneConteneur})
Remark: For a Table based on a data file field, it is advisable to manipulate the fields of a Container column in the "Display a line" event. Limitation: Type of fields not available
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|