Topic: PAGE CONTROL

Hello MVD!

I used the pagination function on te tablegrid. The display i set on the grid per page is 500 records. Now my problem how can i display a records counter on the grid just the normal settings...

Re: PAGE CONTROL

Hello.


Example

procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
    Form1.TableGrid1.Columns[0].Footer.Caption := SQLExecute('SELECT COUNT(*) FROM tablename');
end;
Dmitry.

Re: PAGE CONTROL

BRAVO

Re: PAGE CONTROL

Hello MVD

How to go to the first record or to the last record?

ty

Re: PAGE CONTROL

Hello manixs

I use this piece of code :

procedure Form1_bLast_OnClick (Sender: string; var Cancel: boolean);   //  Go to last record
begin
    Form1.GridEmployees.SelectedRow := Form1.GridEmployees.RowCount - 1;
end;

procedure Form1_bNext_OnClick (Sender: string; var Cancel: boolean);     //  Go to the next record
begin
    Form1.GridEmployees.SelectedRow := Form1.GridEmployees.SelectedRow +1;
end;

procedure Form1_bFirst_OnClick (Sender: string; var Cancel: boolean);    //  Go to the First record
begin
    Form1.TableGrid1.SelectedRow := 0;
end;

procedure Form1_bPrev_OnClick (Sender: string; var Cancel: boolean);   //  Go to the previous record
begin
    Form1.TableGrid1.SelectedRow := Form1.TableGrid1.SelectedRow -1;
    if Form1.TableGrid1.SelectedRow < 0 then Form1.TableGrid1.SelectedRow := 0;

end;

Can this help you ?
JB

Re: PAGE CONTROL

Manixs

Here the correct full code,  I miss copy of my snipet

procedure Form1_bLast_OnClick (Sender: string; var Cancel: boolean);   //  Go to last record
begin
    Form1.TableGrid1.SelectedRow := Form1.TableGrid1.RowCount - 1;
end;

procedure Form1_bNext_OnClick (Sender: string; var Cancel: boolean);     //  Go to the next record
begin
    Form1.TableGrid1.SelectedRow := Form1.TableGrid1.SelectedRow +1;
end;

procedure Form1_bFirst_OnClick (Sender: string; var Cancel: boolean);    //  Go to the First record
begin
    Form1.TableGrid1.SelectedRow := 0;
end;

procedure Form1_bPrev_OnClick (Sender: string; var Cancel: boolean);   //  Go to the previous record
begin
    Form1.TableGrid1.SelectedRow := Form1.TableGrid1.SelectedRow -1;
    if Form1.TableGrid1.SelectedRow < 0 then Form1.TableGrid1.SelectedRow := 0;

end;
JB

Re: PAGE CONTROL

Follow this post for more examples
http://myvisualdatabase.com/forum/viewtopic.php?id=4447

@thezimguy

Re: PAGE CONTROL

THANKS TO ALL SUPPORT


KUDOS!