[lazarus] TDBGrid question

hernan.et at pg.com hernan.et at pg.com
Thu May 22 18:52:35 EDT 2003

Hi Jesus,

Here is what I have done inorder for me to work with TDBGrid.

I added/created a property named BufferCount in TDBGrid class

property BufferCount : Integer Read FBufferCount Write SetBufferCount;

procedure TCustomDBGrid.SetBufferCount(const Count : Integer);
     FBufferCount := count;
     if Count > RowCount then
          FDataLink.BufferCount := count
          FDataLink.BufferCount := RowCount;

I changed UpdateBufferCount to

procedure TCustomDBGrid.UpdateBufferCount;
     if BufferCount <= RowCount then
          FDataLink.BufferCount := RowCount + 1
          FDataLink.BufferCount := BufferCount;//buffer count of this class


The reason I did this was that I discovered when I set FDataLink.BufferCount to more than my table's number of records, I can scroll the TDBGrid fine.

Hope you can validate if this work around is correct.


Yoyong Hernan

 Internet Mail Message                                          
 Received from host:                                            

From: Jesus Reyes <jesusrmx at yahoo.com.mx> on 05/19/2003 05:19 PM GMT
             Jesus Reyes           To:   lazarus at miraclec.com                 
 <jesusrmx at yahoo.com.mx>           Cc:    (bcc: Yoyong Hernan-ET/PGI)         
                           Subject:      Re: [lazarus] TDBGrid question       
     05/20/2003 01:19 AM                                                      
       Please respond to                                                      
    lazarus at miraclec.com                                                      

 --- Michael Van Canneyt <michael.vancanneyt at wisa.be> escribió: >
> On Mon, 19 May 2003 hernan.et at pg.com wrote:
> >
> >
> > Hi Jesus,
> >
> > I have tried using TDBGrid and it work quite well. But I noticed
> that I cannot
> > scroll backward when my table contains more than 10, (my table
> contains 56
> > rows). I have tried to track it down and it seems that the
> problem is somewhere
> > in TDataset or its parent(s). Can someone have a look  on this?
> I've had this issue in the past, and I suspect has something to do
> with the buffer
> scrolling. I have not yet been able to pinpoint the exact error,
> however.
> The procedure you want is in dataset.inc, line 1634
> Procedure TDataset.ShiftBuffers (Offset, Distance : longint);
> Subprocedure 'shiftbuffersdown'.
> I currently do not have enough time to look at it, but if someone
> else
> has, the above info may help to pinpoint the exact problem.
> Michael.

Sorry, I missed the original message from Yoyong. Still I can't
reproduce the problem, I have a dataset with hundreds of rows and i
can go forward/backward without problem. Can you give more details
about dbgrid geometry/dataset derivative, a backtrace?


Jesus Reyes

Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes.

     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

More information about the Lazarus mailing list