[Lazarus] How TDBGrid works

Jesus Reyes A. jesusrmx at gmail.com
Fri May 6 21:52:05 CEST 2016


On Fri, 06 May 2016 13:44:46 -0500, Aradeonas <aradeonas at operamail.com>  
wrote:

> Jesus,In that demo if I set BufferCount to 9 always get 9 records and  
> even Query.RecordCount will be 9 even result is more.
> How can I get real count? I can get count before setting the link but is  
> it the best way?

DbGrid does not do that, and it doesn't have to. And the best way would  
depend, I guess, on the specific situation and what set of components are  
being used.

>
> How can I move or scroll link without moving Query? I want to scroll the  
> grid and get new data without changing RecNo.
> In your example if I only got 9 record for example but I want for  
> example 20th record.
>

Not sure if I understand the part on "moving the query", but using  
TDataset derived components, and without using the basic MoveBy, Locate,  
first, last, next or prev you can't. Some dataset descendants may have  
some properties that help at some cost, for example y you set  
PacketRecords:=-1 then sqldb will load all the records and in this case  
RecordCount may be reliable, that is if dataset is not filtered (or that  
seems to indicate the relevant documentation). Some datasets may actually  
return a valid record count, probably TDbf is in this case. In any case  
without using the mentioned basic operations you can't select records.

> Regards,
> Ara
>

Jesus Reyes A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160506/f1120253/attachment-0003.html>


More information about the Lazarus mailing list