我使用Cxgrid中的cxGrid1TableView显示查询的数据 with cxGrid1TableView1.DataController do begin RecordCount:=0; BeginUpdate; for i:=0 to 100 do begin RecordCount:=RecordCount+1; Values[i,cxgrdbclmnGrid1TableView1Column1.Index]:=IntToStr(i); end; EndUpdate; end; 那么若是数据很多,希望分页显示,就像下图一样,要如何做呢?
I haven't used DevExpress in many years, but I remember that there was a property on the DataControler that controlled how many records you could fetch from the table on each data read.
otherwise, you could make new queries based on the record on the current amount of records already read:
Firebird Database:
select FIRST 10 fieldA, fieldB from tableX;
select SKIP 10 FIRST 10 fieldA, fieldB from tableX;
select SKIP 20 FIRST 10 fieldA, fieldB from tableX;
select SKIP 30 FIRST 10 fieldA, fieldB from tableX;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
DevExpress to Delphi7? I dont know... maybe old DevExpress version to Delphi7...
I dont use MSSQL, but you need just use the params to start and begin the selection, like in Firebird.... or be, see on MSSQL HELP, what is the "key-word" to "SKIP" and "FIRST"...
--- @Page = var used to represent the "page" --- @HowManyByPage = var used to represent "How many records per Page"
... OFFSET, ROWS, FETCH, NEXT, ONLY ....= key-words from MSSQL
OFFSET (@Page - 1) * @HowManyByPage ROWS FETCH NEXT @HowManyByPage ROWS ONLY;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3