Subject TIB_Grid and TopRowNum
Author Luiz Alves
Hi,

My tib_grid has VisibleGridRows=10;

I need to show records one page at a time in a tib_grid, without show
the previous in the new grid page.

For example , if I have 22 records, I need to show:
1. At the first time, the first ten records from 1 to 10 , with the record
one on top of the grid .

2. In the second time, the records from 11 to 20 , with the record 11 at
the top of the grid.

3. In the third time, only records from 21 to 22, with the record 21 the top
of the grid.

4. If I get eof I restart from first record.

I am trying the next, but I am stuck at line where I set the TopRowNum of
the grid.

Does someone could help me?

var
grid_ch: TIB_Grid;
qr_ch:TIB_Query;
Timer1:TTimer; (interval:10 seconds)

procedure Tfm_main_ticket.Timer1Timer(Sender: TObject);
var CanScroll:Boolean;
d,k,j:Integer;
begin
k:=qr_ch.RecordCount;
j:=grid_ch.VisibleGridRows;
CanScroll:=k>j;

if CanScroll then begin
if not qr_ch.eof then begin
d:=qr_ch.MoveBy( j );
grid_ch.TopRowNum:=qr_ch.RowNum;--> Here is the problem
end else qr_ch.first;
end;
end;