Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   TGrid Problem (https://www.delphipraxis.net/179888-tgrid-problem.html)

matthiaskary 9. Apr 2014 08:22

TGrid Problem
 
Hallo,

ich habe auf einem Firemonkey Form ein TGrid mit einer StringColumn und einer ImageColumn. Dieses wird von einer Datenbank zur Laufzeit gefüllt.
Damit die Zeilenanzahl zu der per SQL-Query gefundenen Anzahl passt, setze ich im TGrid,
Rowcount auf die entsprechende Anzahl.

KdGrid.RowCount:=DMKunden.KdAuswahlQuery.RecordCou nt;

Das funktioniert auch soweit ganz gut. Das Problem ist nun, wenn ich z.b. nur 3 Datensätze finde und anschliessend wieder z.b. 1348, bekomme ich beim setzen von Rowcount eine Exception der Klasse $C0000005 mit der Meldung access violation at 0x73300b30:read of adress 0x73300b30

Woran könnte das liegen ? bzw. wie kann ich den Fehler vermeiden ?

Danke im Vorraus.

matthiaskary 9. Apr 2014 08:37

AW: TGrid Problem
 
Hallo nochmal,

habe gerade selbst gefunden woran es lag.

Ich hatte Rowcount vom Grid vor Grid.Beginupdate gesetzt. Setze ich
Rowcount nach BeginUpdate vom Grid, kommt keine Fehlermeldung.


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:05 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz