关于cxGrid 显示字段的问题

crazy_boom 2019-09-20 07:22:51
delphi 10.2.3
uniDAC
Sqlserver 2008R2
dev 18
我写另一个窗体 上面放了 cxgrid uniQuery DataSource

uniquery->DataSource->cxgrid

uniquery1.Close;
uniquery1.SQL.Text:='select dzycode,dzyname,dzykl from docdzy ';
uniquery1.Open;
cxlabel1.Caption:='共有 '+ inttostr(uniquery1.RecordCount) +' 记录';


执行后 cxgird 里是空白的 cxlabel1.caption 显示共有 3 条记录

我以前一直用的DbGridEh 用这个是 open后 会自动将字段展示出来
cxgrid不行 是不是有什么设置呢?

...全文
150 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
要手动添加字段
ucdos781210 2019-09-27
  • 打赏
  • 举报
回复
cxgrid uniQuery DataSource三者之间关系要建立好, cxgrid--> DataSource-->uniQuery
  • 打赏
  • 举报
回复
顶,闲逛接分。
crazy_boom 2019-09-20
  • 打赏
  • 举报
回复
已搞定!

  with spGridView do
  begin
   (DataController as IcxCustomGridDataController).DeleteAllItems;
   (DataController as IcxCustomGridDataController).CreateAllItems(False);
  end;

2,498

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧