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;