cxgrid多选(50分)

M

makecte

Unregistered / Unconfirmed
GUEST, unregistred user!
var i, j: integer;
begin
j := cxGridDBTableView1.DataController.GetSelectedCount;
for i := 0 to cxGridDBTableView1.DataController.GetSelectedCount - 1do
begin
with cxGridDBTableView1.DataControllerdo
begin
qrytemp.RecNo := GetSelectedRowIndex(i) + 1;
end;
end;
以上是没单击列排序时都可以用。如果一单击排序,上面的代码就不行了,定位不到所选那行呢,这如何解决啊
 
没人碰到过这种问题吗
 
你试试看这样的。
if cxview1.DataController.Controller.SelectedRecordCount>0 then
with cxview1.DataController.DataSource.DataSetdo
begin

for i:=0 to cxview1.DataController.Controller.SelectedRecordCount-1do
begin
GotoBookmark(Pointer(cxview1.DataController.GetSelectedBookmark(i)));
//你的代码。
end;
end;
end;
 
GotoBookmark(Pointer(cxview1.DataController.GetSelectedBookmark(i)));
提示 too many actual paramters
 
自己搞定了。哈哈
 

Similar threads

S
回复
0
查看
800
SUNSTONE的Delphi笔记
S
S
回复
0
查看
802
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
877
DelphiTeacher的专栏
D
顶部