- procedure TfrmMain.Button5Click(Sender: TObject);
- var
- I,J: Integer;
- SelectedRows :TBookmarkListEh ;
- s:string;
- begin
- ListBox1.Clear;
- if DBGridEh1.SelectedRows.Count >0 then begin
- with DBGridEh1.DataSource.DataSet do begin
- for I := 0 to DBGridEh1.SelectedRows.Count -1 do begin
- GotoBookmark(Pointer(DBGridEh1.SelectedRows.items[i]));
- s :='';
- for j := 0 to FieldCount -1 do begin
- if J>0 then s :=s + ' ';
- s := s+ Fields[j].AsString;
- end;
- ListBox1.Items.Add(s);
- end;
- end;
- end;
- end;
DBGridEh 多行选择
最新推荐文章于 2025-08-24 09:05:01 发布
本文介绍了一个使用 Delphi 实现的功能,该功能能够将数据网格中选中的行导出到 ListBox 中。通过遍历选中的行并获取对应的数据字段,实现了将表格数据以字符串形式展示的目标。

3121

被折叠的 条评论
为什么被折叠?



