Delphi中ehlib(dbgridEH)多行选择

来源:互联网 发布:飞车暴风雪改装29数据 编辑:程序博客网 时间:2024/05/01 19:27
procedure TForm1.Button1Click(Sender: TObject);
var
i, j: Integer;
s: string;
begin
if DBGrid1.SelectedRows.Count=0 then Exit;

with DBGrid1.DataSource.DataSet do
begin
for i:=0 to DBGrid1.SelectedRows.Count-1 do
begin
GotoBookmark(pointer(DBGrid1.SelectedRows.Items[i]));

for j := 0 to FieldCount-1 do
begin

if (j>0) then s:=s+',';
s:=s+Fields[j].AsString;
end;

s:='';
end;
end;
end;
 
原创粉丝点击