From 4a596b1041ddd6c39a6d0d15b0d887e55711cd16 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 8 Dec 2022 17:56:43 +0000 Subject: [PATCH] GridPrinter: More general code in dbgrid sample project. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8641 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/gridprinter/examples/dbgrid/main.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/gridprinter/examples/dbgrid/main.pas b/components/gridprinter/examples/dbgrid/main.pas index 03f7d0fb2..63ebc758d 100644 --- a/components/gridprinter/examples/dbgrid/main.pas +++ b/components/gridprinter/examples/dbgrid/main.pas @@ -73,7 +73,7 @@ end; procedure TForm1.GridPrinter1BeforePrint(Sender: TObject); begin - BufDataset1.First; + DBGrid1.DataSource.Dataset.First; end; procedure TForm1.Button1Click(Sender: TObject); @@ -182,10 +182,10 @@ var begin dbGrid := AGrid as TDBGrid; if dgTitles in dbGrid.Options then - BufDataset1.RecNo := ARow + dbGrid.DataSource.Dataset.RecNo := ARow // RecNo starts at 1. ARow starts at 1, too, since we display the header row else - BufDataset1.RecNo := ARow + 1; + dbGrid.Datasource.Dataset.RecNo := ARow + 1; // We must add 1 to the row index since the header row is hidder here. end;