|
|
|
|
|
- Overview
- Detail of "UI" tab options
- Initial state of the Table control
- Selection mode ("UI" tab)
- Manage the filling of a table field programmatically ("UI" tab)
- Display line details in an internal window ("UI" tab)
- Detail of "Detail" tab options
- Scrollbar settings
- Column display options ("Detail" tab)
- Options retained for compatibility with older versions ("Detail" tab)
- Forcing the title to be single-line
- 5.5-compatible input mode
Characteristics of Table controls in a window
Table controls allow you to display and/or enter data. This data can be retrieved from a data source, a WLanguage variable or be defined programmatically. The Table field description window displays the characteristics of both the Table field and a Table field column.. The main characteristics of a Table field in a window are as follows: - In the "General" tab:
- Field orientation:
In a WINDEV application window, a table field can be horizontal or vertical.. - Search mode:
It is possible to define the default search mode, proposed in the various columns of the Table field: a search or a "Contains" type filter.. - Calculations on columns:
You can define the type of calculation to be performed on the columns and the location of the result.. For more details, see Calculations in the columns of a Table control. - Column anchoring:
Column docking lets you define which column will be enlarged when the window is resized.. This column is automatically enlarged.. Multiple columns can be anchored.
- In the "UI" tab:
- In the "Details" tab:
Detail of "UI" tab options Initial state of the Table control The initial state of a Table field can be: This initial state is defined when the field is created and can be modified at any time in the "UI" tab of the Table field description window. The different possibilities are as follows: - Visible: Table field will be visible or not. This option can be modified using the Visible property.
- Editable: The user can enter data in the various columns of the Edit control if these columns are being entered..
- Selection (non-editable): The user will not be able to enter data in the Edit control columns.. However, they can select rows in the control: The row will be selected with the selection bar.
Remark: The value in the Table field corresponds to the selected line.. The row selection code is executed each time a row is selected. - No edit, no selection: The user will not be able to enter data in the Edit control columns.. A row can only be selected using TableSelectPlus. This row will be selected with the selection bar. The user will not be able to change the position of the selection bar.
Remark: The value in the Table field corresponds to the selected line.. Conseil: This option is recommended when you need to highlight a line using the selection banner. - Grayed: The Table field and its columns will be grayed out.. The user will not be able to enter data in the control.
Selection mode ("UI" tab) The selection modes define how the different elements of the Table control (rows, columns, cells, etc.) can be selected by the user or programmatically. The selection mode is defined when creating the control. It can be modified at any time in the "UI" tab of the Table control description window. The available selection modes are as follows: - No selection: The selection banner will not be displayed, but the selected row, column or cell will be in focus (it will be surrounded by dotted lines).. A row, column or cell can be selected by clicking on it or programmatically.
- Simple selection: The selected row, column or cell will appear below the selection banner.. A row, column or cell can be selected by clicking on it or programmatically.
- Multiple selection: It is possible to select several rows, columns or cells of the Table field simultaneously:
- with the Shift key if the rows, columns or cells are consecutive or with the Ctrl key if they are not consecutive.
- programmatically.
In this case, there will be as many selection bars as there are selected elements.
Remarks: - A WLanguage error will occur if you try to select multiple rows programmatically and the selection mode is set to "Single selection".
- During a multiple selection by cell, to select a row, all the cells found in the row must be selected. To make this operation easier, you can define a row selector ("Style" tab, "Row selector" element, "Selector" option, "Left arrow").
The selected elements will be retrieved: - with the TableSelect function. You can use the tsRow, tsColumn, tsCellRow and tsCellColumn constants to retrieve information on the selected rows, columns and cells.
- with the TableSelectCount function. You can use the tsRow, tsColumn, tsCellRow and tsCellColumn constants to retrieve the number of rows, columns and cells selected.
Example: The following example shows how to get the row and column number for the selected cells in the Table control.
NbSelected is int
NbSelected = TableSelectCount(TABLE_DetailedStats, tsCell)
FOR i = 1 _TO_ NbSelected
nRow = TableSelect(TABLE_DetailedStats, i, tsCellRow)
nColumn = TableSelect(TABLE_DetailedStats, i, tsCellColumn)
...
END
Detail of "Detail" tab options Column display options ("Detail" tab) There are multiple options to configure the display mode of the columns. These options are available in the "Details" tab of the description window of the Table control. These options are as follows: - Remember column configuration: This option memorizes column configuration (size, order, etc.) when the window or application is closed..
- 'Select columns...' menu: This option displays a context menu so that the user can select which columns to show or hide in the Table field..
- Multiline text columns: This option makes text columns multiline.. Thus, the entire text is displayed in the cell, regardless of how long it is.
- Maximum number of lines displayed in a row: In the line of a Table field, several lines can be displayed. This option sets the maximum number of lines a cell can display, to prevent content from spreading over too many lines, making the row unnecessarily high.
- Number of columns fixed to the left: This option specifies the number of columns fixed on the left.. These columns will remain visible on the left side of the control and cannot be moved. The user will not be able to hide these columns using the horizontal scrollbar.
The user can also freeze or unfreeze columns via the "Padlock" cursor or the "Freeze columns on the left" option in the context menu of the column title. For more details, see Freezing columns in Table controls. You can also freeze a column programmatically with TableFixColumn. - Angle for the title of columns: For columns with a large title and reduced content, it is possible to reduce the column size by tilting the column title (or, for example, by moving it directly to the vertical).. To do so, specify the desired angle in the "Details" tab of the control description. This option can be modified using the OrientationTitle property.
- Edit column title-headers: Column overheads can be defined.. A column title-header is an additional title displayed above the title of one or more columns. For more details, see Managing titles of columns in a Table control.
Note: Column titles are multiline by default.. The height of the header fits automatically to the number of lines. The titles of the columns support RTF. Options retained for compatibility with older versions ("Detail" tab) Forcing the title to be single-line By default, the title of columns found in a Table control is multiline. The option "Force title in a singleline (8)" allows you to go back to 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|