Hello,
i get a GPF after I move a column with the mouse to a different position when i first sort the grid via a sql order by statement as it shown in the dbAdvGrid example. If I dont sort before moving no GPF occurs. I use PageMode=True and FireDac with an sqLite databse using Delphi 10 Seattle. dbAdvGrid has version 2.3.8.6
Can you reproduce this problem and have a hint whats going wrong here?
My OnCanSort procedure:
DoSort := False;
if gdGrid.SortSettings.Direction = sdAscending then
gdGrid.SortSettings.Direction := sdDescending
else
gdGrid.SortSettings.Direction := sdAscending;
fldname := db.quFillGrid.FieldList.Fields[gdGrid.ColumnAtPosition(ACol) ].FieldName;
db.quFillGrid.SQL.Text := 'select * from myTable ORDER BY '+fldname;
if gdGrid.SortSettings.Direction = sdDescending then
db.quFillGrid.SQL.Text := db.quFillGrid.SQL.Text + ' DESC';
db.quFillGrid.Active := true;
gdGrid.SortSettings.Column := ACol;
The GPF:
In Project MyBrowser.exe ist eine Exception der Klasse EAccessViolation mit der Meldung 'Zugriffsverletzung bei Adresse 004CB52F in Modul 'MyBrowser.exe'. Lesen von Adresse 8103013B' aufgetreten.
The line of code which crashes:
procedure TDBGridColumnItem.SetField(Value: TField);
if Assigned(FField) and Assigned(Grid) then
---->> FField.RemoveFreeNotification(Grid);
Structure of My Table:
CREATE TABLE t(
id INTEGER PRIMARY KEY,
Cat VarChar(100),
ResetNew Integer,
tID Integer UNIQUE,
Title VarChar(255),
ComCnt Integer,
Seed Integer,
FileSize VARCHAR(20),
isNew Integer,
hasInfo Integer,
IMDB VarChar(50),
imdbRating Single,
imdbVotes Integer,
Progress Integer,
DateDown Integer,
DateUp Integer,
Marked Integer
);