PC SOFT

WINDEV的在线文档

  • Overview
  • Initial status of the Table control
  • Details of the display options
  • Selection mode
  • Selection mode
  • Display options of the cloumns
  • 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
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The Table control is used to display and/or enter information. This information can come from a data source, from a WLanguage variable, or it can be stored.

This help page presents the main settings 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 a Table control for more details.

Initial status of the Table control
The initial status of a Table control can be:
This initial status is defined when creating the control and it can be modified in the "GUI" tab of the characteristics of the Table control.

The different possibilities are as follows:

  • 可见: The Table control will be visible or not. This option can be modified by programming with ..可见.
  • Editable: The user will be able to perform an input in the control columns if these columns are in edit.
  • 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 表格选择行.
      The row will be selected via the selection bar.
      Note: The value of the 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 表格选择行. This row will be selected via the selection bar. The user will not be able to modify the position of the selection bar.
    Note: The value of the Table control corresponds to the selected row.
    Tip: This option is recommended when a row must be highlighted via the selection bar.
  • 变灰: The Table control and its columns will be grayed. The user will not be able to enter information in the control.

Details of the 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 the 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.
  • 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.
Note: A WLanguage error will occur if you try to perform a multiple selection by programming while the selection mode of the 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. 表格选定元素数目 is used to find out the number of rows selected in the Table control:

// Traces the content of selected rows
i整数型
NbSelected整数型表格选定元素数目TABLE_Product
对于i1直到NbSelected
跟踪"Selected row: "+TABLE_Product表格选定行TABLE_Producti)】)
结束

16版本和更高版本
WinDev A selection mode can be defined for the rows, columns and cells of a Table control.
16新版本
WinDev A selection mode can be defined for the rows, columns and cells of a Table control.
WinDev A selection mode can be defined for the rows, columns and cells of a Table control.
16版本和更高版本

Selection mode

The selection modes define how the different elements of the 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 the Table control.

The available selection modes are as follows:

  • 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.
Notes:
  • 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 selector ("Style" tab, "Row Selector" element, "Selector" option corresponding to "Left arrow").
The selected elements will be retrieved:
  • by browsing the rows selected in the Table control. 表格选定元素数目 is used to find out the number of rows selected in the control.
    // Traces the content of selected rows
    i整数型
    NbSelected整数型表格选定元素数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected row: "+TABLE_Product表格选定行TABLE_Producti)】)
    结束
  • by browsing the columns selected in the Table control. 表格选定列数目 is used to find out the number of columns selected in the control.
    // Traces the content of the selected columns
    i整数型
    NbSelected整数型表格选定列数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected column: "+Table_PRODUCT表格选定列TABLE_Producti)】)
    结束
  • by browsing the cells selected in the Table control. 表格选定单元格数目 is used to find out the number of cells selected in the control.
    // Traces the content of the selected cells
    i整数型
    NbSelected整数型表格选定单元格数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected cell: "+...
    Table_PRODUCT表格选定单元格TABLE_Producti表格单元格选择.)】
    表格选定单元格TABLE_Producti表格单元格选择.)】)
    结束
The selected elements will be retrieved:
  • by 表格选定行. The 表格选定.行, 表格选定.列, 表格选定.单元格的行号 and 表格选定.单元格的列号 constants are used to respectively retrieve information about the rows, the columns and the cells.
  • by 表格选定元素数目. The 表格选定.行, 表格选定.列, 表格选定.单元格的行号 and 表格选定.单元格的列号 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整数型
NbSelected表格选定元素数目TABLE_DetailedStats表格选定.单元格
// Browse the selected cells
对于i1最优直到NbSelected
// Retrieve the row and the column
nRow表格选定行TABLE_DetailedStatsi表格选定.单元格的行号
nColumn表格选定行TABLE_DetailedStatsi表格选定.单元格的列号
// Process
...
结束

16新版本

Selection mode

The selection modes define how the different elements of the 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 the Table control.

The available selection modes are as follows:

  • 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.
Notes:
  • 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 selector ("Style" tab, "Row Selector" element, "Selector" option corresponding to "Left arrow").
The selected elements will be retrieved:
  • by browsing the rows selected in the Table control. 表格选定元素数目 is used to find out the number of rows selected in the control.
    // Traces the content of selected rows
    i整数型
    NbSelected整数型表格选定元素数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected row: "+TABLE_Product表格选定行TABLE_Producti)】)
    结束
  • by browsing the columns selected in the Table control. 表格选定列数目 is used to find out the number of columns selected in the control.
    // Traces the content of the selected columns
    i整数型
    NbSelected整数型表格选定列数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected column: "+Table_PRODUCT表格选定列TABLE_Producti)】)
    结束
  • by browsing the cells selected in the Table control. 表格选定单元格数目 is used to find out the number of cells selected in the control.
    // Traces the content of the selected cells
    i整数型
    NbSelected整数型表格选定单元格数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected cell: "+...
    Table_PRODUCT表格选定单元格TABLE_Producti表格单元格选择.)】
    表格选定单元格TABLE_Producti表格单元格选择.)】)
    结束
The selected elements will be retrieved:
  • by 表格选定行. The 表格选定.行, 表格选定.列, 表格选定.单元格的行号 and 表格选定.单元格的列号 constants are used to respectively retrieve information about the rows, the columns and the cells.
  • by 表格选定元素数目. The 表格选定.行, 表格选定.列, 表格选定.单元格的行号 and 表格选定.单元格的列号 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整数型
NbSelected表格选定元素数目TABLE_DetailedStats表格选定.单元格
// Browse the selected cells
对于i1最优直到NbSelected
// Retrieve the row and the column
nRow表格选定行TABLE_DetailedStatsi表格选定.单元格的行号
nColumn表格选定行TABLE_DetailedStatsi表格选定.单元格的列号
// Process
...
结束

Selection mode

The selection modes define how the different elements of the 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 the Table control.

The available selection modes are as follows:

  • 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.
Notes:
  • 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 selector ("Style" tab, "Row Selector" element, "Selector" option corresponding to "Left arrow").
The selected elements will be retrieved:
  • by browsing the rows selected in the Table control. 表格选定元素数目 is used to find out the number of rows selected in the control.
    // Traces the content of selected rows
    i整数型
    NbSelected整数型表格选定元素数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected row: "+TABLE_Product表格选定行TABLE_Producti)】)
    结束
  • by browsing the columns selected in the Table control. 表格选定列数目 is used to find out the number of columns selected in the control.
    // Traces the content of the selected columns
    i整数型
    NbSelected整数型表格选定列数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected column: "+Table_PRODUCT表格选定列TABLE_Producti)】)
    结束
  • by browsing the cells selected in the Table control. 表格选定单元格数目 is used to find out the number of cells selected in the control.
    // Traces the content of the selected cells
    i整数型
    NbSelected整数型表格选定单元格数目TABLE_Product
    对于i1直到NbSelected
    跟踪"Selected cell: "+...
    Table_PRODUCT表格选定单元格TABLE_Producti表格单元格选择.)】
    表格选定单元格TABLE_Producti表格单元格选择.)】)
    结束
The selected elements will be retrieved:
  • by 表格选定行. The 表格选定.行, 表格选定.列, 表格选定.单元格的行号 and 表格选定.单元格的列号 constants are used to respectively retrieve information about the rows, the columns and the cells.
  • by 表格选定元素数目. The 表格选定.行, 表格选定.列, 表格选定.单元格的行号 and 表格选定.单元格的列号 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整数型
NbSelected表格选定元素数目TABLE_DetailedStats表格选定.单元格
// Browse the selected cells
对于i1最优直到NbSelected
// Retrieve the row and the column
nRow表格选定行TABLE_DetailedStatsi表格选定.单元格的行号
nColumn表格选定行TABLE_DetailedStatsi表格选定.单元格的列号
// Process
...
结束

Display options of the cloumns

A large number of options are available for configuring the display of the columns.You have the ability to display the column titles over several lines. The height of the header is automatically adjusted to the number of lines. The titles of columns support the RTF format.
This option is available in the "Details" tab of the description window of the Table control.
By default, the column titles are multi-line. The height of the header is automatically adjusted to the number of lines. The titles of columns support the RTF format.

Notes:
  • 16版本和更高版本
    WinDev For the columns with a large title and a reduced content, you have the ability to reduce the size of the columns by changing the orientation of the title (or by writing it vertically for example). To do so, specify the requested angle in the "Details" tab of the description of the table control. This option can be modified by programming with ..标题角度.
    16新版本
    WinDev For the columns with a large title and a reduced content, you have the ability to reduce the size of the columns by changing the orientation of the title (or by writing it vertically for example). To do so, specify the requested angle in the "Details" tab of the description of the table control. This option can be modified by programming with ..标题角度.
    WinDev For the columns with a large title and a reduced content, you have the ability to reduce the size of the columns by changing the orientation of the title (or by writing it vertically for example). To do so, specify the requested angle in the "Details" tab of the description of the table control. This option can be modified by programming with ..标题角度.
  • 18版本和更高版本
    WinDev You have the ability to define a title-header for columns. A title-header of columns is an additional title displayed above the title of one or more columns.
    18新版本
    WinDev You have the ability to define a title-header for columns. A title-header of columns is an additional title displayed above the title of one or more columns.
    WinDev You have the ability to define a title-header for 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
WinDev 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 operation is ended. Depending on the data source to browse, this process may be run for quite a long time after the opening of the window.

The options regarding the scrollbar are grouped in the "Details" tab of the description of the 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 "multi-line" row of a Table control can be truncated if necessary when it is displayed.

15版本和更高版本
WinDev 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.
15新版本
WinDev 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.
WinDev 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 titles of a Table control columns are multi-line. 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 multi-line column title.

WinDev

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 the 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.