To obtain or set the number of records of a Grid or Freestyle Grid.
The RecordCount returns the number of records of the Grid that meet the selection conditions. It may return -1 if the program could not determine it (it was not assigned and it could not be calculated automatically).
||It could not be determined. Typically, the Grid does not have a base table or the loading conditions are evaluated client side.
||Since the program could not calculate it automatically, you should set its value in the Refresh event.
||Number of records of the Grid base table
This property applies only at run-time.
1) Grid with base table (GridCount could be calculated automatically)
2) Grid is based on SDT (GridCount could be calculated automatically)
&Clients = ClientsGet()
for &Client in &Clients
&Clientid = &Client.ClientId
&ClientName = &Client.ClientName
3) Grid is loaded from external sources (RecordCount could not be calculated automatically)
This case requires that RecordCount is assigned in the Refresh Event. If not, the Pagecount could not be determined when the Web Panel loads.
grid1.Rows = 5
grid1.RecordCount = 12
for &i = 1 to 12
&ClientId = GetClientId(&i)
&ClientName = GetClientName(&i)
Objects: Web Panel
Platforms: Web(.Net, Java), Web(.Net Core)
Controls: FreeStyle Grid, Grid
Grid paging on the Web
Paging in apps