ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Characteristics of column elements
  • Position of added column
  • Limits: Maximum number of columns displayed
  • Data-bound Table control: Changes to the linked table
  • Data-bound Table control: Add multiple columns
  • Adding records to a data-bound Table control and Trigger
  • Adding an image
  • Table control in edit mode
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds elements on the right of an Horizontal Table control.
Warning This function cannot be used to add columns to a standard Table field (vertical Table field). To dynamically add columns into a standard Table control, use ControlClone.
Syntax
<Result> = <Table control>.AddColumn([<Element row 1> [... [, <Element row N>]]])
<Result>: Integer
  • Index of the new column,
  • -1 if an error occurred.
<Table control>: Control name
Name of the Horizontal Table control to be used.
<Element row 1>: Type of associated row (optional)
Elements of column to add to the specified Table control. Each element corresponds to a row. The type of the added element must be compatible with the type of the relevant row.
If none of these parameters is specified, an empty column is added to the Table control. For a data-bound Table control, the default values defined in the linked table are taken into account.
<Element row N>: Type of associated column (optional)
Elements of column to add to the specified Table control. Each element corresponds to a row. The type of the added element must be compatible with the type of the relevant row.
If none of these parameters is specified, an empty column is added to the Table control. For a data-bound Table control, the default values defined in the linked table are taken into account.
Remarks

Characteristics of column elements

  • To specify no value for an element, use an empty string ("") or 0 (according to the type of the row).
  • If an element corresponds to the result of a calculation, enclose the numerical expression in brackets. For example:
    TABLE_TableCalcul.AjouteColonne((53+29), (83-21))

Position of added column

By default, the column is added at the end of the Table control.
  • If the Table control is sorted by <Table>.Sort, the added column is positioned in the control according to the current sort.
  • If the Table control is sorted by the user, the sort is ignored when the column is added. The column is added at the end of the control.

Limits: Maximum number of columns displayed

The maximum number of columns that can be displayed in a Table control is limited only by available RAM (theoretical maximum: 2 billion columns).
However, we do not recommend using Table controls with a large number of columns for performance reasons (time required to fill the control for example) and for user-friendliness.

Data-bound Table control: Changes to the linked table

If the cascading input is enabled, the table linked to the data-bound Table control is automatically modified when the user goes to the next column.
If the cascading input is not enabled, the table linked to the data-bound Table control is not modified. To write the added column into the linked table, <Table>.Save must be used after <Table>.AddColumn.
Reminder The "Cascading input (Add)" option can be selected:
  • When creating a Table control.
  • In the "Details" tab of the control description.

Data-bound Table control: Add multiple columns

A virtual column is created each time <Table>.AddColumn is called in a data-bound Table control based on a table. The information will be saved in the table during the call to <Table>.Save.
If <Table>.AddColumn is successively called in the same process without being followed by <Table>.Save, only the FIRST call is effective (the following calls are ignored). Only one column is added to the data-bound Table control based on a table.

Adding records to a data-bound Table control and Trigger

A trigger can be released when a record is added in a data-bound Table control based on a table. For more details, see the documentation about <Source>.DescribeTrigger.

Adding an image

To add an image into a Table control, specify the name and full path of image to add.
For example:
TABLE_MaTable.AjouteColonne("C:\MesDocuments\MonImage.BMP")

Note To display the added image correctly, the line must be of type Image.

Table control in edit mode

If <Table>.AddColumn is called:
  • In an event of the Table control, the cursor is automatically positioned on the first row to edit in the added column.
  • In an event that does not belong to the Table control (or in a custom process), SetFocusAndReturnToUserInput must be used to resume the input in the Table control.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/01/2024

Send a report | Local help