PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Use conditions
  • Multi-selection Table control
  • Horizontal Table control
  • Managing errors
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 row or swaps two rows in a Table control. To move the columns in a Table control, use <Table>.MoveColumn.
Versions 16 and later
WINDEVLinux This function is now available for WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for WINDEV applications in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Versions 19 and later
WEBDEV - Browser code This function is now available in Browser code for Table controls in browser mode.
New in version 19
WEBDEV - Browser code This function is now available in Browser code for Table controls in browser mode.
WEBDEV - Browser code This function is now available in Browser code for Table controls in browser mode.
Versions 20 and later
Android This function is now available for Android applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 20
Android This function is now available for Android applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Android This function is now available for Android applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
// Swap the current row and row 5
TABLE_Table1.MoveLine(SelectedLine, 5, amSwap)
// Move the current row to row 3
TABLE_Table1.MoveLine(SelectedLine, 3, amMove)
// Swap the current row with the next row
TABLE_Table1.MoveLine(SelectedLine, 5, amNext, amSwap)
Syntax

Moving to a specific position Hide the details

<Result> = <Table control>.MoveLine(<Index of row to move> , <Destination row index> [, <Operation to perform>])
<Result>: Integer
New index of the row that was moved.
<Table control>: Control name
Name of the Table control to be used.
<Index of row to move>: Integer
Position of the row to move. This position must be between 1 and the number of rows in the Table control (returned by <Table>.Count or Count, for example).
To move the row that is currently selected, use the rowSelected constant.
<Destination row index>: Integer
New row position. This position must be between 1 and the number of rows in the Table control (returned by <Table>.Count or Count, for example). A fatal error occurs if this parameter is not valid.
To handle the row that is currently selected, use the rowSelected constant.
<Operation to perform>: Optional Integer constant (or combination of constants)
Change of position that will be performed for the row:
amDisplayDestinationThe modified row is displayed in the Table control. An automatic scroll of the rows is performed if necessary to display the modified row in the Table control. The selected row (selection bar) is not modified.
This constant can be combined with the amMove and amSwap constants.
WEBDEV - Server codePHP Table in Ajax mode: The modified row will always be displayed at the top of Table control.
amMove
(default value)
The row is moved to the index of the destination row.
amSwapThe source row and the destination row are swapped.
WINDEVWEBDEV - Server codeAndroidiPhone/iPadJavaUser code (UMC)PHPAjax

Moving relatively to the current position Hide the details

<Result> = <Table control>.MoveLine(<Index of row to move> , <Relative move> [, <Operation to perform>])
<Result>: Integer
New index of the row that was moved.
<Table control>: Control name
Name of the Table control to be used.
<Index of row to move>: Integer
Position of the row to move. This position must be between 1 and the number of rows in the Table control (returned by <Table>.Count or Count, for example).
To handle the row that is currently selected, use the rowSelected constant.
<Relative move>: Integer constant
Used to move or a swap to a position relative to the index of the row to move.
amFirstMoves the row to first position.
amLastMoves the row to last position.
amNextMoves the row one position downwards.
amNextPageMoves the row one page to the bottom (a page corresponds to the number of rows that can be simultaneously displayed in the Table control).
amPreviousMoves the row one position upwards
amPreviousPageMoves the row one page to the top (a page corresponds to the number of rows that can be simultaneously displayed in the Table control).

If this parameter is invalid (amPrevious constant used on the first row of the Table control for example), the row is moved "to the nearest" position.
<Operation to perform>: Optional Integer constant (or combination of constants)
Change of position that will be performed for the row:
amDisplayDestinationThe modified row is displayed in the Table control. An automatic scroll of the rows is performed if necessary to display the modified row in the Table control. The selected row (selection bar) is not modified.
This constant can be combined with the amMove and amSwap constants.
WEBDEV - Server codePHP Table in Ajax mode: The modified row will always be displayed at the top of Table control.
amMove
(default value)
The row is moved to the index of the destination row.
amSwapThe source row and the destination row are swapped.
Remarks

Use conditions

<Table>.MoveLine can be used on:
  • a Table control populated programmatically.
  • a Table control with in-memory data source.
  • WINDEVReports and QueriesJavaUser code (UMC) a horizontal Table control.
  • WEBDEV - Server codePHP an Ajax Table control or a standard Table control.
  • WEBDEV - Browser code a Table control in browser mode.
This function cannot be used on the TreeView Table controls and on the Table controls based on a data file (direct access).
Remarks: Moving a row according to the type of control:

Multi-selection Table control

If <Table>.MoveLine is used on a multi-selection Table control:
  • when moving a row (amMove constant): only the first selected row will be moved.
  • when swapping rows (amSwap constant): only the first row will be swapped
  • the rowSelected constant cannot be used. Otherwise, a fatal error occurs and no row is moved.
WINDEVReports and QueriesJavaUser code (UMC)

Horizontal Table control

If <Table>.MoveLine is called on a horizontal Table control, the elements moved will be the columns.
To move the rows in a horizontal Table control, use <Table>.MoveColumn.

Managing errors

Caution: <Table>.MoveLine returns no error code. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
WEBDEV - Browser code ErrorInfo is not available.
Component: wd270obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment