DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: jeff1314
今日帖子: 0
在线用户: 3
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 ken0137 (顺眼即佛) ★☆☆☆☆ -
普通会员
2023/6/8 0:26:25
标题:
请问使用CxGrid控件如何分页显示 浏览:715
加入我的收藏
楼主: 我使用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;
那么若是数据很多,希望分页显示,就像下图一样,要如何做呢?
此帖子包含附件:
PNG 图像
大小:446.2K
----------------------------------------------
只会简单使用,并未精通深入
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/6/8 3:56:06
1楼: 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
作者:
男 ken0137 (顺眼即佛) ★☆☆☆☆ -
普通会员
2023/6/8 10:19:50
2楼: 有没有在D7下的DevExpress 版本在14.1.3下的方式?
若数据库是mssql的,要如何操作,
若非数据库的数据,1k条,分10页要如何操作?
----------------------------------------------
只会简单使用,并未精通深入
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/6/9 7:09:17
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"...

see this post on StackOverFlow:

https://pt.stackoverflow.com/questions/168260/limit-e-offset-para-pagina%C3%A7%C3%A3o-web-em-sql-server



--- @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
作者:
男 bjlg (蓝天) ★☆☆☆☆ -
盒子活跃会员
2024/2/20 14:06:22
4楼: sq语句本身就有分页功能吧
----------------------------------------------
http://delphi.icm.edu.pl/ftp/http://delphi-z.ru
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行75.19531毫秒 RSS