cxGRID如何遍历已经选择的单元格

dacsd 2006-12-28 10:09:02
cxGRID如何遍历已经选择的单元格
...全文
297 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dacsd 2006-12-29
  • 打赏
  • 举报
回复
谢谢:YouTuBe(天不言自高,地不言自厚,人不言自无能,水不言自下流)
我的问题主要就是不能确定选择的列,请问如何得到选择的列
YouTuBe 2006-12-29
  • 打赏
  • 举报
回复
n := cxGrid1DBTableView1.DataController.GetSelectedCount;

for i:=0 to n - 1 do
begin
Index := cxGrid1DBTableView1.DataController.GetSelectedRowIndex(i);
if Index < 0 then continue;
AccID :=
cxGrid1DBTableView1.DataController.GetRowValue(
cxGrid1DBTableView1.DataController.GetRowInfo(Index)
,0);//这里的0是列的索引,可以指定,也可用通过GridView获取

end;
YouTuBe 2006-12-29
  • 打赏
  • 举报
回复
n := cxGrid1DBTableView1.DataController.GetSelectedCount;

for i:=0 to n - 1 do
begin
Index := cxGrid1DBTableView1.DataController.GetSelectedRowIndex(i);
if Index < 0 then continue;
AccID :=
cxGrid1DBTableView1.DataController.GetRowValue(
cxGrid1DBTableView1.DataController.GetRowInfo(Index)
,0);
AccID := dsData.DataSet.FieldByName('AccountID').AsString;

end;

2,497

社区成员

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

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