Board index » delphi » Record Numbers

Record Numbers

On Wed, 6 Aug 1997 18:29:02 -0500, "Greg Johnson"

Quote
<gjohn...@mail.icongrp.com> wrote:
>user scrolls through the table he can see what record he is on.  The thing
>worked pretty well, except if I was at the top of the table (record 1) and
>used nextrecord to move to record 2,3,etc. the record number would not
>change, until I got to the first record not visible on the grid. Same thing
>happens when at the bottom of the table. Moving up record by record would
>not change the record # until I got to the first record off the grid.

I had the same type of problems.  Where did you put the code to update
the record number info?  

I'm displaying the key field info in the form's caption, and it works
with the code in the TDataSource OnDataChange event.

I'm guessing the problems are due to the fact that the grid buffers in
the records, and only really goes to the database when it needs more
records.

Chuck Gadd
Director of Software Development, {*word*104} FX Communications.
e-mail:cgadd-NOS...@{*word*104}-fx.com  http://www.csd.net/~cgadd
Remove the -NOSPAM from my email address to send me e-mail.
*** I boycott businesses that send me unsolicited email adverti{*word*224}ts ***

 

Re:Record Numbers


What event are you using to trigger the updating of the record number?
It should be the OnDataChange event of the datasource for the grid.

Try something like:
  EditRecordNumber.Text := IntToStr(TableName.RecNo)

This will update the number displayed by an edit control called
EditRecordNumber whenever the active record of the table object called
TableName changes.

Quote
> I am moving an application from Paradox to Delphi  (keeping the Pdox
>tables).  I tried adding a "record n of nn" comment on the form, so as a
>user scrolls through the table he can see what record he is on.  The thing
>worked pretty well, except if I was at the top of the table (record 1) and
>used nextrecord to move to record 2,3,etc. the record number would not
>change, until I got to the first record not visible on the grid. Same thing
>happens when at the bottom of the table. Moving up record by record would
>not change the record # until I got to the first record off the grid.

>Any thoughts ?
>TIA
>--
>Greg R. Johnson
>CompuCom

>gjohn...@mail.icongrp.com
>http://cgi.icongrp.com/~gjohnson/

Other Threads