DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: wugangbest
今日帖子: 24
在线用户: 23
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 xiaobaosoft (小宝软件) ▲▲△△△ -
普通会员
2021/1/22 14:33:33
标题:
FMX grid 虚拟化 有严重问题 浏览:1135
加入我的收藏
楼主: 300W数据
ongetvalue 事件赋值

几百万数据 拉到下面直接导致 绘图错乱
此帖子包含附件:
PNG 图像
大小:41.9K
----------------------------------------------
-
作者:
男 xiaobaosoft (小宝软件) ▲▲△△△ -
普通会员
2021/1/22 14:34:47
1楼: 滚轮滚动后
此帖子包含附件:
PNG 图像
大小:47.1K
----------------------------------------------
-
作者:
男 xiaobaosoft (小宝软件) ▲▲△△△ -
普通会员
2021/1/22 14:35:41
2楼: 内容显示数字
此帖子包含附件:
PNG 图像
大小:45.7K
----------------------------------------------
-
作者:
男 glwang (glwang) ★☆☆☆☆ -
盒子活跃会员
2021/1/22 21:05:50
3楼: 试试Woll2Woll – FirePower X
----------------------------------------------
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/1/24 1:09:41
4楼: type
  TForm1 = class(TForm)
    Button1: TButton;
    Grid1: TGrid;
    procedure Button1Click(Sender: TObject);
    procedure Grid1GetValue(Sender: TObject; const ACol, ARow: Integer; var Value: TValue);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

var
  iCounterToGetValueEvent: Integer = 0;

procedure TForm1.Button1Click(Sender: TObject);
var
  Column1: TColumn;
  Column2: TColumn;
  Column3: TColumn;
begin
  Grid1.ClearColumns;
  //
  Column1 := TColumn.Create(Grid1);
  Column2 := TColumn.Create(Grid1);
  Column3 := TColumn.Create(Grid1);
  //
  Grid1.AddObject(Column1); // 3 columns
  Grid1.AddObject(Column2);
  Grid1.AddObject(Column3);
  //
  Grid1.RowCount := 50;
end;

procedure TForm1.Grid1GetValue(Sender: TObject; const ACol, ARow: Integer; var Value: TValue);
begin
  {
    Occurs when the grid needs to retrieve a value from an external repository to use as the content of one of the cells in this grid.
    Write an OnGetValue event handler to take specific actions when you retrieve a value from an external repository to use as the content of one of the cells in this grid.
  }
  //
  Value := 'abc'; // for all TColumns if NOT USING verify any condition! example: if ACol = 0 then ... ;
  //
  inc(iCounterToGetValueEvent); // all time that "GetValues" is called ... many and many time... include in "Scroll" rows... up or down!
  //
  // "n" Columns X "n" Rows  + "n" Visible Rows on Grid
  //
  // Pay attention on first time, and later, when scrolling the rows to up or down
  //
  Caption := Format('Counting... iCounterToGetValueEvent = %d, VisibleRows = %d', [ { }
      iCounterToGetValueEvent,          { }
      Grid1.VisibleRows          { }
    ]);
end;

end.

 (n rows = visible rows) x ( n columns=3) + (visible rows=13)  
   or "N" calls of the event x (n columns) x (x rows) 



按此在新窗口浏览图片
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/1/24 1:39:08
5楼: 按此在新窗口浏览图片
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 wenyue0811 (wenyue0811) ★☆☆☆☆ -
普通会员
2021/1/24 11:35:50
6楼: 厉害了, 一次要加载百万行记录???? FMX 说, 我不是 VCL. 我真的一次吃不下这么大个锅呀......


emailx45 的方法是可行的.一次加载不要太多的指定数量的记录(比如: 50 或 100 或 Grid 的高度刚好适应的记录数量, 然后 MOUSE 滚动到显示出来的最后一条记录后, 再显示下面的指定记录数的记录..以此类推...
----------------------------------------------


美国国务卿蓬佩奥回答大学生提问时说,“我曾担任美国中央情报局(CIA)的局长。我们撒谎、我们欺骗、我们偷窃。我们还有一门课程专门来教这些。这才是美国不断探索进取的荣耀
作者:
男 wenyue0811 (wenyue0811) ★☆☆☆☆ -
普通会员
2021/1/24 11:46:47
7楼: 当然, 如果你一次性加载18000条记录, 7字段. 时间大约在200毫秒左右.速度也还行. 使用的 SQLITE. 记录行上也没有差乱.(以我的程序显示出来的效果看)..
----------------------------------------------


美国国务卿蓬佩奥回答大学生提问时说,“我曾担任美国中央情报局(CIA)的局长。我们撒谎、我们欺骗、我们偷窃。我们还有一门课程专门来教这些。这才是美国不断探索进取的荣耀
作者:
男 xiaobaosoft (小宝软件) ▲▲△△△ -
普通会员
2021/1/24 14:00:18
8楼: @wenyue0811
采用的是虚拟化的列表。

也就是显示多少提取多少 并没有全部加载进去。
----------------------------------------------
-
作者:
男 xiaobaosoft (小宝软件) ▲▲△△△ -
普通会员
2021/1/24 14:02:45
9楼: @emailx45
Allready use GetValue Event

like  visual List  

But when count is bilion  

you can see like my pic
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行125毫秒 RSS