PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
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.
Syntax
<Result> = <Table control>.AddColumn([<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.
<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:
    TABLE_CalculationTable.AddColumn((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 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, <Table>.Save must be used after <Table>.AddColumn.
Reminder: The option "Cascading input (Addition)" can be selected:
  • When creating a Table control.
  • In the "Details" tab of control description.

Browsing Table control: Adding several columns

Whenever <Table>.AddColumn 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 <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). 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 image to add.
For example:
TABLE_MyTable.AddColumn("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 <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), ReturnToCapture must be used to resume the input in the Table control.
Component : wd240obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment