Hi,
I have a grid connected to a ClientDataSet. Everything works fine till the amount of data to be displayed increase. In case we have 40000 rows it becomes very slow. Is there any possibility to preload (paginate) somehow automatically the loading of data?
Geanni
Preload data
-
AndreyZ
Re: Preload data
Hello,
To solve the problem, you should set the FetchAll property to False. Here is a code example:In this case data will be fetched by 25 records when it is explicitly requested.
To solve the problem, you should set the FetchAll property to False. Here is a code example:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
MyQuery1.FetchAll := False;
MyQuery1.FetchRows := 25;
DataSetProvider1.DataSet := MyQuery1;
ClientDataSet1.SetProvider(DataSetProvider1);
ClientDataSet1.PacketRecords := 25;
ClientDataSet1.Open;
end;