PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Initial status of Table control
  • Details of display options
  • Selection mode
  • Selection mode
  • Display options of columns
  • Scrollbars in a Table control
  • Options kept for backward compatibility with the earlier versions
  • Forcing the title to be single-line
  • 5.5-compatible input 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
Overview
The Table control is used to display and/or type information. This information can come from a data source, from a WLanguage variable, or it can be stored.
This help page presents the main characteristics that can be defined for a Table control found in a window:
You also have the ability to define the data source displayed in the control. See Content of Table control for more details.
Versions 20 and later
Android The Table control is now available for Android applications.
iPhone/iPad The Table control is now available for iPhone/iPad applications.
New in version 20
Android The Table control is now available for Android applications.
iPhone/iPad The Table control is now available for iPhone/iPad applications.
Android The Table control is now available for Android applications.
iPhone/iPad The Table control is now available for iPhone/iPad applications.
Initial status of Table control
The initial status of a Table control can be:
Initial status of Table control
This initial status is defined when creating the control and it can be modified at any time in the "GUI" tab of the characteristics of Table control.
The different possibilities are as follows:
  • Visible: The Table control will be visible or not. This option can be modified by programming with ..Visible.
  • Editable: The user will be able to perform an input in the control columns if these columns are in edit.
    iPhone/iPad The Table control is not available in edit. It is available in read-only.
  • Selection (without edit): The user will not be able to perform an input in the control columns. A control row can be selected:
    • by clicking this row.
    • by using TableSelectPlus.
      The row will be selected via the selection bar.
      Remark: The value of Table control corresponds to the selected row. The code for row selection is run for each selection.
  • No edit, no selection: The user will not be able to perform an input in the control columns. A control row can only be selected by programming with TableSelectPlus. This row will be selected via the selection bar. The user will not be able to modify the position of the selection bar.
    Remark: The value of Table control corresponds to the selected row.
    Tip: This option is recommended when a row must be highlighted via the selection bar.
  • Grayed: The Table control and its columns will be grayed. The user will not be able to enter information in the control.
Details of display options

Selection mode

The selection modes define how a row of the Table control can be selected by the user or by programming. This selection mode is defined when creating the control. It can be modified at any time in the "GUI" tab of the characteristics of Table control.
The available selection modes are as follows:
  • No selection: No selection bar will be displayed, however the selected row will have focus (it will be bordered by dots). A row can be selected by clicking this row or by programming.
  • Single selection: The selected row will be displayed underneath the selection bar. A row can be selected by clicking this row or by programming.
    Versions 20 and later
    AndroidiPhone/iPad Android/iOS selection mode: This option is used to hide the selection bar after the selection. This allows you to get the standard operating mode on these platforms: the bar appears when pressing on the row. Then, the code for row selection is run.
    New in version 20
    AndroidiPhone/iPad Android/iOS selection mode: This option is used to hide the selection bar after the selection. This allows you to get the standard operating mode on these platforms: the bar appears when pressing on the row. Then, the code for row selection is run.
    AndroidiPhone/iPad Android/iOS selection mode: This option is used to hide the selection bar after the selection. This allows you to get the standard operating mode on these platforms: the bar appears when pressing on the row. Then, the code for row selection is run.
  • Multi-selection: You have the ability to select several rows simultaneously:
    • with the Shift key if the rows are consecutive or with the Ctrl key if the rows are not consecutive.
    • by programming.
      In this case, the number of selection bars is equal to the number of selected rows.
Remark: A WLanguage error will occur if you try to perform a multiple selection by programming while the selection mode of control is set to "Single selection".
The multiple selection is available for the "Browsing table" controls.
The selected elements will be retrieved by browsing the rows selected in the control. TableSelectCount is used to find out the number of selected rows in the Table control:
// Traces the content of selected rows
i is int
NbSelected is int = TableSelectCount(TABLE_Product)
FOR i = 1 TO NbSelected
Trace("Selected row: " + TABLE_Product[TableSelect(TABLE_Product, i)])
END
Versions 16 and later

Selection mode

The selection modes define how the different elements of Table control (row, column, cell) can be selected by the user or by programming. This selection mode is defined when creating the control. It can be modified at any time in the "GUI" tab of the characteristics of Table control.
The available selection modes are as follows:
Selection modes
  • No selection: No selection bar will be displayed, however the selected row, column or cell will have focus (it will be bordered by dots). A row, a column or a cell can be selected by a click on this element or by programming.
  • Single selection: The selected row, column or cell will be displayed underneath the selection bar. A row, a column or a cell can be selected by a click on this element or by programming.
  • Multi-selection: Several rows, columns or cells of the Table control can be selected at the same time:
    • with the Shift key if the rows, columns or cells are consecutive or with the Ctrl key if the elements are not consecutive.
    • by programming.
      In this case, the number of selection bars will be equal to the number of selected elements.
Remarks:
  • A WLanguage error will occur if you try to perform a multiple selection by programming while the selection mode is set to "Simple selection".
  • During a multiple selection by cell, to select a row, all the cells found in the row must be selected. To simplify this operation, you have the ability to display a row picker ("Style" tab, "Row picker" element, "Picker" option corresponding to "Left arrow").
The selected elements will be retrieved:
  • by browsing the rows selected in the Table control. TableSelectCount is used to find out the number of rows selected in the control.
    // Traces the content of selected rows
    i is int
    NbSelected is int = TableSelectCount(TABLE_Product)
    FOR i = 1 TO NbSelected
    Trace("Selected row: " + TABLE_Product[TableSelect(TABLE_Product, i)])
    END
  • by browsing the columns selected in the Table control. TableColumnSelectOccurrence is used to find out the number of columns selected in the control.
    // Traces the content of selected columns
    i is int
    NbSelected is int = TableColumnSelectOccurrence(TABLE_Product
    FOR i = 1 TO NbSelected
    Trace("Selected column: " + Table_PRODUCT[TableColumnSelect(TABLE_Product, i)])
    END
  • by browsing the cells selected in the Table control. TableCellSelectOccurrence is used to find out the number of cells selected in the control.
    // Traces the content of selected cells
    i is int
    NbSelected is int = TableCellSelectOccurrence(TABLE_Product)
    FOR i = 1 TO NbSelected
    Trace("Selected cell: " + ...
    Table_PRODUCT[TableCellSelect(TABLE_Product, i, tcsLine)]
    [TableCellSelect(TABLE_Product, i, tcsColumn)])
    END
The selected elements will be retrieved:
  • with TableSelect. The tsRow, tsColumn, tsCellLine and tsCellColumn constants are used to respectively retrieve information about the rows, the columns and the cells.
  • with TableSelectCount. The tsRow, tsColumn, tsCellLine and tsCellColumn constants are used to respectively retrieve the number of rows, columns and cells.
Example: The following example is used to retrieve detailed statistics for the selected cells in the Table control.
// Retrieve the number of selected cells
NbSelected is int
NbSelected = TableSelectCount(TABLE_DetailedStats, tsCell)
// Browse the selected cells
FOR i = 1 _TO_ NbSelected
// Retrieve the row and the column
nRow = TableSelect(TABLE_DetailedStats, i, tsCellLine)
nColumn = TableSelect(TABLE_DetailedStats, i, tsCellColumn)
// Process
...
END
AndroidiPhone/iPadWindows Mobile Only the selection mode of rows is available.
New in version 16

Selection mode

The selection modes define how the different elements of Table control (row, column, cell) can be selected by the user or by programming. This selection mode is defined when creating the control. It can be modified at any time in the "GUI" tab of the characteristics of Table control.
The available selection modes are as follows:
Selection modes
  • No selection: No selection bar will be displayed, however the selected row, column or cell will have focus (it will be bordered by dots). A row, a column or a cell can be selected by a click on this element or by programming.
  • Single selection: The selected row, column or cell will be displayed underneath the selection bar. A row, a column or a cell can be selected by a click on this element or by programming.
  • Multi-selection: Several rows, columns or cells of the Table control can be selected at the same time:
    • with the Shift key if the rows, columns or cells are consecutive or with the Ctrl key if the elements are not consecutive.
    • by programming.
      In this case, the number of selection bars will be equal to the number of selected elements.
Remarks:
  • A WLanguage error will occur if you try to perform a multiple selection by programming while the selection mode is set to "Simple selection".
  • During a multiple selection by cell, to select a row, all the cells found in the row must be selected. To simplify this operation, you have the ability to display a row picker ("Style" tab, "Row picker" element, "Picker" option corresponding to "Left arrow").
The selected elements will be retrieved:
  • by browsing the rows selected in the Table control. TableSelectCount is used to find out the number of rows selected in the control.
    // Traces the content of selected rows
    i is int
    NbSelected is int = TableSelectCount(TABLE_Product)
    FOR i = 1 TO NbSelected
    Trace("Selected row: " + TABLE_Product[TableSelect(TABLE_Product, i)])
    END
  • by browsing the columns selected in the Table control. TableColumnSelectOccurrence is used to find out the number of columns selected in the control.
    // Traces the content of selected columns
    i is int
    NbSelected is int = TableColumnSelectOccurrence(TABLE_Product
    FOR i = 1 TO NbSelected
    Trace("Selected column: " + Table_PRODUCT[TableColumnSelect(TABLE_Product, i)])
    END
  • by browsing the cells selected in the Table control. TableCellSelectOccurrence is used to find out the number of cells selected in the control.
    // Traces the content of selected cells
    i is int
    NbSelected is int = TableCellSelectOccurrence(TABLE_Product)
    FOR i = 1 TO NbSelected
    Trace("Selected cell: " + ...
    Table_PRODUCT[TableCellSelect(TABLE_Product, i, tcsLine)]
    [TableCellSelect(TABLE_Product, i, tcsColumn)])
    END
The selected elements will be retrieved:
  • with TableSelect. The tsRow, tsColumn, tsCellLine and tsCellColumn constants are used to respectively retrieve information about the rows, the columns and the cells.
  • with TableSelectCount. The tsRow, tsColumn, tsCellLine and tsCellColumn constants are used to respectively retrieve the number of rows, columns and cells.
Example: The following example is used to retrieve detailed statistics for the selected cells in the Table control.
// Retrieve the number of selected cells
NbSelected is int
NbSelected = TableSelectCount(TABLE_DetailedStats, tsCell)
// Browse the selected cells
FOR i = 1 _TO_ NbSelected
// Retrieve the row and the column
nRow = TableSelect(TABLE_DetailedStats, i, tsCellLine)
nColumn = TableSelect(TABLE_DetailedStats, i, tsCellColumn)
// Process
...
END
AndroidiPhone/iPadWindows Mobile Only the selection mode of rows is available.

Selection mode

The selection modes define how the different elements of Table control (row, column, cell) can be selected by the user or by programming. This selection mode is defined when creating the control. It can be modified at any time in the "GUI" tab of the characteristics of Table control.
The available selection modes are as follows:
Selection modes
  • No selection: No selection bar will be displayed, however the selected row, column or cell will have focus (it will be bordered by dots). A row, a column or a cell can be selected by a click on this element or by programming.
  • Single selection: The selected row, column or cell will be displayed underneath the selection bar. A row, a column or a cell can be selected by a click on this element or by programming.
  • Multi-selection: Several rows, columns or cells of the Table control can be selected at the same time:
    • with the Shift key if the rows, columns or cells are consecutive or with the Ctrl key if the elements are not consecutive.
    • by programming.
      In this case, the number of selection bars will be equal to the number of selected elements.
Remarks:
  • A WLanguage error will occur if you try to perform a multiple selection by programming while the selection mode is set to "Simple selection".
  • During a multiple selection by cell, to select a row, all the cells found in the row must be selected. To simplify this operation, you have the ability to display a row picker ("Style" tab, "Row picker" element, "Picker" option corresponding to "Left arrow").
The selected elements will be retrieved:
  • by browsing the rows selected in the Table control. TableSelectCount is used to find out the number of rows selected in the control.
    // Traces the content of selected rows
    i is int
    NbSelected is int = TableSelectCount(TABLE_Product)
    FOR i = 1 TO NbSelected
    Trace("Selected row: " + TABLE_Product[TableSelect(TABLE_Product, i)])
    END
  • by browsing the columns selected in the Table control. TableColumnSelectOccurrence is used to find out the number of columns selected in the control.
    // Traces the content of selected columns
    i is int
    NbSelected is int = TableColumnSelectOccurrence(TABLE_Product
    FOR i = 1 TO NbSelected
    Trace("Selected column: " + Table_PRODUCT[TableColumnSelect(TABLE_Product, i)])
    END
  • by browsing the cells selected in the Table control. TableCellSelectOccurrence is used to find out the number of cells selected in the control.
    // Traces the content of selected cells
    i is int
    NbSelected is int = TableCellSelectOccurrence(TABLE_Product)
    FOR i = 1 TO NbSelected
    Trace("Selected cell: " + ...
    Table_PRODUCT[TableCellSelect(TABLE_Product, i, tcsLine)]
    [TableCellSelect(TABLE_Product, i, tcsColumn)])
    END
The selected elements will be retrieved:
  • with TableSelect. The tsRow, tsColumn, tsCellLine and tsCellColumn constants are used to respectively retrieve information about the rows, the columns and the cells.
  • with TableSelectCount. The tsRow, tsColumn, tsCellLine and tsCellColumn constants are used to respectively retrieve the number of rows, columns and cells.
Example: The following example is used to retrieve detailed statistics for the selected cells in the Table control.
// Retrieve the number of selected cells
NbSelected is int
NbSelected = TableSelectCount(TABLE_DetailedStats, tsCell)
// Browse the selected cells
FOR i = 1 _TO_ NbSelected
// Retrieve the row and the column
nRow = TableSelect(TABLE_DetailedStats, i, tsCellLine)
nColumn = TableSelect(TABLE_DetailedStats, i, tsCellColumn)
// Process
...
END
AndroidiPhone/iPadWindows Mobile Only the selection mode of rows is available.

Display options of columns

Several options are available for configuring the display of columns. These options are available in the "Details" tab of the description window of the Table control.
You have the ability to display the column titles over several lines. The height of header is automatically adjusted to the number of rows. The titles of columns support the RTF format.
This option is available in the "Details" tab of the Table control description window.
Display options of columns
Display options of columns
The column titles are multiline by default. The height of header is automatically adjusted to the number of rows. The titles of columns support the RTF format.
Remarks:
  • Versions 18 and later
    AndroidiPhone/iPad You have the ability to define title-headers of columns. A title-header of columns is an additional title displayed above the title of one or more columns.
    New in version 18
    AndroidiPhone/iPad You have the ability to define title-headers of columns. A title-header of columns is an additional title displayed above the title of one or more columns.
    AndroidiPhone/iPad You have the ability to define title-headers of columns. A title-header of columns is an additional title displayed above the title of one or more columns.
See Managing the titles of columns in a Table control for more details.
Scrollbars in a Table control
Windows Mobile By default, the scrollbars found in Table controls (browsing table, memory table or table on source) are proportional scrollbars. The size of the scrollbar is proportional to the number of elements to display.
Caution: if a filter is used with a proportional scrollbar, the data source is browsed in background task. The "end of initialization" code will be run when the browse is ended. Depending on the data source to browse, this process may be run for quite a long time after the window opening.
The options regarding the scrollbar are grouped in the "Details" tab of the Table control description:
Parameters of the scrollbar in a Table control
The option "Move by pixel" allows for a soft move of the rows: instead of "jumping" from a row to another one, the move is performed pixel by pixel: a "multiline" row of a Table control can be truncated if necessary when it is displayed.
Remark: Disabling the proportional scrollbar disables the multiselection of rows.
Versions 15 and later
Windows Mobile The "Move with finger" option is used to specify that the Table control accepts the scrolling with finger (if the display device is touch-enabled). This option is enabled by default in WINDEV Mobile for the new Table controls. In WINDEV, it is disabled by default.
New in version 15
Windows Mobile The "Move with finger" option is used to specify that the Table control accepts the scrolling with finger (if the display device is touch-enabled). This option is enabled by default in WINDEV Mobile for the new Table controls. In WINDEV, it is disabled by default.
Windows Mobile The "Move with finger" option is used to specify that the Table control accepts the scrolling with finger (if the display device is touch-enabled). This option is enabled by default in WINDEV Mobile for the new Table controls. In WINDEV, it is disabled by default.
Options kept for backward compatibility with the earlier versions

Forcing the title to be single-line

By default, the title of columns found in a Table control is multiline. The option "Force the title to single-line" is used to restore the default behavior of version 8.
On the Table controls created with version 8 (or earlier), this option must be unchecked in order to get a multiline column title.
Windows Mobile

5.5-compatible input mode

This mode is used to restore the operating mode of the Table controls in version 5.5. This option is automatically checked if the Table control comes from a migrated WINDEV 5.5 application. This option is available in the "Details" tab of the description of the Table control.
This option must not be used for Table controls created with version 7 (or later) of WINDEV.
All the features of the Table controls will be accessible if this option is unchecked. To restore the operating mode of the Table controls in WINDEV 5.5, the code of control must be adapted.
Two types of Table controls are available if this option is checked:
  • editable Table control without selection.
  • non-editable Table control with selection and input (if no column is in edit or if the Table control is in selection without edit).
Reminder: in version 5.5, if the Table control was defined:
  • as "editable" and if at least one control column was in edit, the selection band was not displayed and it was possible to perform an input in the Table control.
  • as "editable" (or "inactive") and with no column in edit, the user could not perform any input in the Table control but he could modify the position of the selection bar.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment