ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Table Column control
  • Overview
  • Characteristics of the columns in a Table control in a window
  • Image of column title
  • Resize column
  • Sortable column
  • Movable column
  • Search (Search icon / Filter)
  • Export and print
  • Fixed column, anchored column
  • Fixed column
  • Anchored column
  • Progress Bar column
  • Description
  • Progress bar with a different upper bound for each row of the Table control
  • Properties that can be used on a Progress Bar cell
  • Calculated column and Check Box column (Table control populated programmatically and with in-memory data source)
  • Calculated column and Check Box column
  • Style of Check Box columns
  • Other characteristics of Check Box columns
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
In a Table field, columns are used to display information.. The same type of information is displayed in the same column.
The Table field description window lets you add, delete and specify column characteristics using various tabs.. Specific characteristics can be configured for each type of column.
The following types of data can be displayed in a column:
  • Text
  • Currency
  • Time
  • Combo Box
  • Image
  • Progress Bar
    Java Not available.
  • Numeric
  • Date
  • Caption
  • Check Box
  • Duration
  • Container
    (not available in Java and in WINDEV Mobile)
The following paragraphs present the main characteristics of the Table control columns displayed in a window, available regardless of the column type.
Remarks:
Characteristics of the columns in a Table control in a window
Most characteristics of the columns found in a Table control are configured in the "General" tab of the characteristics of each column.
Characteristics of columns

Image of column title

This option allows you to define the image that will be used as the background image of the column title.

Resize column

If a column is resizable:
  • The user can change the size of the columns with the mouse.
  • This column will be automatically resized with the "Adjust all columns" option in the context menu of the column header.
Programming in WLanguage:
  • You can resize columns using TableAdjust.
  • You can make columns resize to fit their content by using AAFExecute with the aafAdjustAllColumns constant.

Sortable column

The user will be able to sort the column via a click performed on its header. This option is available:
  • for all columns in a Table or TreeView Table control populated programmatically.
  • for some columns in the Table control based on a data file (only columns based on key items and without filter).
WINDEV The "Options" button allows you to define the characteristics of the sort on Text columns.
By ticking the "Customize sort" option, you can select the sorting mode or combinations of sorting you require..
Tip: Enable the "gXXX functions" option : This option sorts the column according to the content defined with the gLink function..
To use this feature, simply call gLink in the display event of a row. For example, to display the dates in fully readable format and sort the column by date, the row display code is:
sDateTriable is string
// Récupère le gLien pour le tri + la valeur à afficher
sDateTriable = gLink(dDate) + DateToDayInAlpha(dDate) + " " + ...
    dDate.Jour + " " + DateToMonthInAlpha(dDate)+ " " + dDate.Année
// Affiche la date en toutes lettres et trie sur le format normal de date
TableAddLine(TABLE_Commandes, Commande.NuméroInterneCommande, sDateTriable, ... )

Note: At runtime, the Ascending sort and Descending sort icons indicate the column sort direction at all times.. You can customize the images used. For more details, see Configuring the titles of the columns found in a Table control.
WLanguage programming: Sorting can also be programmed using the:
TableSortUsed to sort the content of a Table or TreeView Table control on one or more columns
TableSortChildUsed to sort a branch of a TreeView Table control on one or more columns (lexicographical sort).

The SortOption property allows you to define the sorting options.
WINDEV An optional event can also be managed: Whenever the column is sorted.

Movable column

The user will be able to move the column in the Table control and to change the order in which the columns are displayed.

Search (Search icon / Filter)

The user will be able to implement a "Starts with" filter in the column. Only the elements starting with the letters typed for the column will be displayed.
WINDEVJava Two methods are available:
  • The user types the sought word directly. This search is automatically performed in the sorted column.
  • Clicking a column header with a search icon opens an edit control. The user will only have to type the sought word.
The search icon is available:
  • for all the columns in a Table control populated programmatically.
  • for the columns of Table controls based on a data file with automatic iteration (only sortable columns based on key items, and without filter).
Attention: The magnifying glass is not available:
  • for items associated with a multi-file link.
  • for the Table controls that use a non-proportional scrollbar ("Proportional scrollbar" unchecked in the "Details" tab of the description window of the Table control).
WINDEVJava You can customize the search icon. For more details, see Configuring the titles of the columns found in a Table control.
Programming: This function can be programmed using the:
TableSearchSearches for a value in a column of a Table or TreeView Table control based on a data file or populated programmatically.
TableSearchChildSearches for a value in a column of a TreeView Table control, in a specified branch.

WINDEV An optional event can also be managed: Whenever performing a search with the search icon.
WINDEV

Export and print

The table column can be taken into account during the print and in the exports:
  • Always,
  • Never,
  • If the column is visible in the window.
Note: This option will be taken into account:
Programming: This option can be programmed using property VisibleInExportAndPrint.
Fixed column, anchored column
WINDEVWindows

Fixed column

A fixed column will always remain displayed during the horizontal scroll of the Table columns. If the column is not fixed, it will move along with the other columns. The fixed columns are always located on the left of the Table control.
You can set the number of fixed columns in the Table control description ("Details" tab, Number of columns fixed to the left). The first x columns will be fixed.
WINDEVWindows

Anchored column

The anchored column is the column onto which the anchoring options will be applied. The column width will change according to the size of the window and the Table control.
You can define:
  • the number of the anchored column in the "General" tab of the Table control description.
  • the anchor rate in width of a column in the "UI" tab of the description window of the column.
Progress Bar column
WINDEVWindows

Description

The configuration of the progress bar is performed in the "General" tab of the column description. You can configure:
  • the initial value of the progress bar,
  • the maximum value of progress bar,
  • the active image and the background image.
The "Details" tab of the column description is used to configure the display of the progress percentage, ...
WINDEVWindows

Progress bar with a different upper bound for each row of the Table control

You have the ability to display a progress bar with a different upper bound for each row. In this case, you must:
  1. Assign the MaxValue property to 100 for the column.
  2. Perform the desired calculation in the display code of the row:
    <Colonne Jauge> = <Valeur Jauge>*100/<Valeur Max>
WINDEVWindows

Properties that can be used on a Progress Bar cell

You can use the MaxValue and MinValue properties on the Progress Bar cells using the following syntax:
<Nom de la colonne>[<Numéro de la ligne>].BorneMax = <Valeur>
<Nom de la colonne>[<Numéro de la ligne>].BorneMin = <Valeur>
Calculated column and Check Box column (Table control populated programmatically and with in-memory data source)
WINDEVWindows

Calculated column and Check Box column

In a Table field based on a data file, it is possible to create calculated columns: these columns are not linked to a data file.. These columns can display a calculation, for example, ...
"Check Box" columns in a Table control with in-memory data source are specific calculated columns. When scrolling through the control, checked boxes keep their selected state.
Note: In a Table based on a data file with direct access, calculated columns of the Check Box control type (not linked to a field) are not retained when lines are dequeued.
WINDEVWindows

Style of Check Box columns

It is possible to define the style of the Switches present in the columns: for example, it is possible to choose the image that will be used when the option is selected.
To define the style of Check Box columns:
  1. Open the Table control description window.
  2. On the "Style" tab, select the "Check Box column" element. You can:
    • select the checkmark style among one of the preset styles.
    • choose a specific image for representing the checkmark ("Checkmark style" option corresponding to "Checkmark image").
WINDEVWindows

Other characteristics of Check Box columns

The Check Box columns also propose the following features:
  • Context menu used to check/uncheck table rows and to filter them. For more details, see Context menu of Check Box columns (AAF).
  • Option to hide unchecked boxes in read-only Table controls ("Hide the checkmark if unchecked (read-only)" option in the "Details" tab of the column description window or EmptyIfZero property).
Related Examples:
Style for displaying the table cells Unit examples (WINDEV): Style for displaying the table cells
[ + ] Modifying the display style of table cells.
The ..BrushStyle property is used to hatch the cells or to create a color gradient with "tube" effect.
Custom Calculations Unit examples (WINDEV): Custom Calculations
[ + ] Using a formula entered by the user in a Table control.
The formula is entered in the column and stored in a .INI file in order to be used whenever the table is displayed. The formula can be modified at any time by the user.
The Table/TreeView Table control (Progress Bar columns) Unit examples (WINDEV): The Table/TreeView Table control (Progress Bar columns)
[ + ] Using a Progress Bar column as well as the ..TextProgressBar property in a Table or TreeView Table control
Minimum version required
  • Version 12
This page is also available for…
Comments
Table with create columns runtime
FiltraUsuarios("")

//AlteraNomeColunasQuery("TABLE_usuario","QRY_Select_All_Usuarios")

//usando a estrutura da query
sColuna is string = pTableNameControl+".COL_Column"
ItemList is string = HListItem( {pQueryName,indFile} , hLstDetail)
CountCampos is int = StringCount(ItemList,CRLF)

//c is int
//
//loop (CountCampos)
// c+=1
//
// //TableInsertColumn /// windev
//
//END


ItemList = Replace(ItemList,CRLF,";")
ItemList = Replace(ItemList,TAB,";")
x is int = 6
y is int = 0
VARTEXT is string
LOOP(CountCampos)
y+= 1
VARTEXT = ExtractString(ItemList,x,";",FromBeginning)
{sColuna+y,indControl}..Caption = VARTEXT
{sColuna+y,indControl}..Visible = True
x+= 6
END
BOLLER
25 Jun. 2018

Last update: 09/21/2024

Send a report | Local help