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);
begin
FBufferCount := count;
if Count > RowCount then
FDataLink.BufferCount := count
else
FDataLink.BufferCount := RowCount;
end;
I changed UpdateBufferCount to
procedure TCustomDBGrid.UpdateBufferCount;
begin
if BufferCount <= RowCount then
FDataLink.BufferCount := RowCount + 1
else
FDataLink.BufferCount := BufferCount;//buffer count of this class
end;
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.
Regards,
Yoyong Hernan
Internet Mail Message
Received from host:
svcr-216-37-230-2.dsl.svcr.epix.net
[216.37.230.2]
From: Jesus Reyes on 05/19/2003 05:19 PM GMT
Jesus Reyes To:
Cc: (bcc: Yoyong Hernan-ET/PGI)
Subject: Re: [lazarus] TDBGrid question
05/20/2003 01:19 AM
Please respond to
--- Michael Van Canneyt escribi�: >
Show quoted text 32 lines
On Mon, 19 May 2003 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?
Thanks.
Jesus Reyes
_________________________________________________________ Do You Yahoo!?
La mejor conexi�n a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives