ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Use conditions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the number of selected elements in a Table or TreeView Table control (especially for a multi-selection control).
The number of selected elements can correspond to:
  • the number of selected rows (current rows onto which the selection bar is displayed).
  • the number of selected cells if the controls allows the selection mode by cell. This option can be configured in the "UI" tab of the control description.
  • the number of selected columns if the control allows the selection mode by column. This option can be configured in the "UI" tab of the control description.
Example
// Trace le contenu des lignes sélectionnées
// (Le champ Table est un champ Table multisélection)
i is int 
NbSelectionne is int 
NbSelectionne = TABLE_Produit.SelectOccurrence() 
FOR i = 1 TO NbSelectionne
	Trace("Ligne sélectionnée : " + ...
		TABLE_Produit[TABLE_Produit.Select(i)]) 
END
// Supprime toutes les lignes sélectionnées dans un champ Table
// (Le champ Table est un champ Table multisélection)
// A partir de la version 18, la fonction TableSupprimeSelect est disponible
i is int
NbSelection is int = TABLE_MaTable.SelectOccurrence()
FOR i = NbSelection TO 1 STEP -1
	TABLE_MaTable.Supprime(TABLE_MaTable.Select(i))
END
Syntax
<Result> = <Table control>.SelectCount([<Information to return>])
<Result>: Integer
  • Number of selected rows in the specified control,
  • 0 if no row is selected.
This number can be greater than 1 for multi-selection controls.
<Table control>: Control name
Name of the control to be used. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
<Information to return>: Integer constant
Type of information to return:
tsCell<Result> will correspond to the number of selected cells.
tsColumn<Result> will correspond to the number of selected columns.
tsRow
(Default value)
<Result> will correspond to the number of selected rows.

If this parameter is not specified, the function will return the number of selected rows.
Java This parameter is not available.
Remarks

Use conditions

<Table>.SelectCount can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • single-selection or multi-selection controls.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Select ID
Prezados

Para pegar um registro id de um browser table grid tem 2 formas:

Crie uma var global da janela:
GNID is 8-byte int = 0


A) Em Code evento
SELECT ROW

GNID = TableNameGrid.COL_myID



B) Em Code evento
SELECT ROW

Nx is int = Tableinfoxy(TableNameGrid, tiLineNumber, MouseXPos(), MouseYPos())

If nx > 0

GNID = TableNameGrid[nx].COL_myID

End
Boller
16 Apr. 2024

Last update: 09/18/2024

Send a report | Local help