mostly the first record is displayed in the grid (pagemode = false) two times (in two rows). So the number of the last record is greater than the record count. The grid gets its information by a SQL-statement. What is to do to solve this problem?
dmPaWo.qryPW.SQL.Add('ORDER BY ' + sQrySort + ' DESC');
end;
end;
dmPaWo.qryPW.Open;
adbgMain.Reload;
adbgMain.DataSource.DataSet.EnableControls;
After the first call It displays the correct number of records, after all later one record two times. This is the same on another table with another DBAdvgrid.
For the grids I set Rowselect = True and no editing of the cell, PageMode = False.
When I insert a new record to the dataset I refresh the grid with this (partial) method.
Without the Reloaf-function It displays always with the first call one row more.
I found a solution for the problem: If I remove the "Order by"-clause from the Query than it works correctly.
But now I have another Problem: At program start the query seraches for all records. If the user select a category the query searches fior all records only with the selected category. So I chnage the query. But the grid works still with the old query and displays all records. How can I tell the grid to use the new query?