DBGridEh怎么读取选中的行的数据

2025-03-07 03:05:05
推荐回答(1个)
回答1:

操作方法如下:
var
i,j:integer;
str: string;
Begin
str:='';
for i:=0 to DBgrid1.selectedrows.count-1 do
begin
Gotobookmark(pointer(DBgrid1.selectedrows.ites[i]));
for j:=0 to fieldcount-1 do
Begin
if j>0 then
str:=','+str;
str:=fields[i].Asstring;
End;
listbox1.items.add(str);
str:='';
End;
End;