PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Characteristics of column elements
  • Position of added column
  • Limits: Maximum number of displayed columns
  • Browsing Table control: Modifications in the linked data file
  • Browsing Table control: Adding several columns
  • Addition into a browsing Table control and trigger
  • Adding an image
  • Table control in edit mode
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
TableAddColumn (Function)
In French: TableAjouteColonne
Adds elements on the right of an Horizontal Table control.
Caution: This function cannot be used to add columns into a standard Table control (vertical Table control). To dynamically add columns into a standard Table control, use ControlClone.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Syntax
<Result> = TableAddColumn(<Table Name> [, <Element Row 1> [, ... [, <Element Row N>]]])
<Result>: Integer
  • Subscript of added column,
  • -1 if an error occurred.
<Table Control>: Control name
Name of Horizontal Table control to use.
If this parameter corresponds to an empty string (""), the Table control to which the current process belongs will 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 browsing Table control, the default values defined in the linked data file 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 browsing Table control, the default values defined in the linked data file 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 calculation result, the numeric expression must be enclosed in brackets. For example:
    TableAddColumn(TABLE_CalcTable, (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 TableSort, 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 displayed columns

The maximum number of columns that can be displayed in a Table control is limited by the amount of available memory (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.

Browsing Table control: Modifications in the linked data file

If the cascading input is enabled, the data file linked to the browsing Table control is automatically modified when the user goes to the next column.
If the cascading input is not enabled, the data file linked to the browsing Table control is not modified. To write the added column into the linked data file, TableSave must be used after TableAddColumn.
Reminder: The "Cascading input" option can be selected:
  • When creating a Table control.
  • In the "Details" tab of control description.

Browsing Table control: Adding several columns

Whenever TableAddColumn is called in a browsing Table control, a virtual row is created in the control. The information will be saved in the data file during the call to TableSave.
If TableAddColumn is successively called in the same process without being followed by TableSave, only the FIRST call is effective (the following calls are ignored). A single column is added into the browsing Table control.

Addition into a browsing Table control and trigger

You have the ability to release a trigger when a record is added into a browsing Table control. See the documentation about HDescribeTrigger for more details.

Adding an image

To add an image into a Table control, specify the name and full path of the image to add.
For example:
TableAddColumn(TABLE_MyTable, "C:\MyDocuments\MyImage.BMP")
Note: The row must be an Image row otherwise the image will not be displayed properly.

Table control in edit mode

If TableAddColumn is called:
  • In a process of the Table control, the cursor is automatically positioned on the first row to edit in the added column.
  • In a process not belonging to the Table control, ReturnToCapture must be used to resume the input in the Table control.
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Linux wd230obj.so
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment