ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Use conditions
  • The different types of column indices
  • Move and anchor columns
  • Moving columns in horizontal Table controls
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
Moves a column in a Table or TreeView Table control.
Remarks:
  • To move a row in a Table control, use <Table>.MoveLine.
  • This function is equivalent to the following operation performed at runtime: click the header of a column and move the column while keeping the left mouse button down.
Example
// Move the "COL_ProductPrice" column
// on the far left side in the "TABLE_ProductTable" control
TABLE_ProductTable.MoveColumn(COL_ProductPrice, 1)
Syntax
<Table control>.MoveColumn(<Column> , <Index of destination column>)
<Table control>: Control name
Name of the control to be used. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
<Column>: Control name
Name of the column to move. The column name is returned by <Table>.EnumColumn.
<Index of destination column>: Integer
New position of the column in the control. The first column (even if it is invisible) is column #1.
Remarks

Use conditions

<Table>.MoveColumn can be used on:
  • a Table or TreeView Table control based on a data file.
  • a Table or TreeView Table control populated programmatically.
  • a single-selection or multiselection control.
WEBDEV - Server code This function is available for Table controls in "Server" and "Server + AJAX" mode, and for TreeView Table controls.
WEBDEV - Browser code This function is available for Table controls in "Browser" mode only. The TreeView Table control is not available.

The different types of column indices

There are 2 types of indices for columns:
  • Index of the visible position: index of the column at runtime.
  • Creation index: index of the column when creating the Table control in the editor.
These indices change if the user moves the columns.
<Table>.MoveColumn uses the index of the visible position.

Move and anchor columns

  • If the column is moved among some anchored columns, this column automatically becomes anchored.
  • If the column is moved outside the anchored columns, this column is not anchored anymore.
WINDEVReports and QueriesJavaUser code (UMC)

Moving columns in horizontal Table controls

  • If <Table>.MoveColumn is called on a horizontal Table control, the rows will be moved.
  • To move the columns in a horizontal Table control, use <Table>.MoveLine.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/20/2023

Send a report | Local help