LastPage method

Official Content
This documentation is valid for:

Goes to the last group of records when paging of Grids and Free Style Grids is used.

Syntax

Grid.LastPage()

Scope

Controls: Grid, Free Style Grid
Generators: .NET, .NET Framework, Java, Ruby (up to GeneXus X Evolution 3)

Description

This method is available in Web Panel objects, but it can only be used when the Grid has Base Table.

The Rows property must have a value different than 0. 

Grids may be nested. 

The LastPage method determines what the last page will be. To this end, it uses the Rows property and the Grid RecordCount property. Using the RecordCount property implies that the DBMS (not the generated code) sweeps the Grid base table twice (the first time to count and the second to "load"). 

The LastPage method makes it possible to have just one Load command executed per each record in the base table. Thus, if there are Ifs in the Grid.Load event, which may condition the execution of the command, or if the Load method is executed more than once for each record, outcomes may be unexpected.  

Values

Value Result
0 Successful operation
1 Paging is not enabled in the Grid 
3 The Grid does not have a base table.

Samples

Event Last.Click
    MyGrid.LastPage()
EndEvent

See Also

FirstPage method
NextPage method
PreviousPage method
[GotoPage method|]
RecordCount property
PageCount Property
Rows property
Grid paging on the Web