I need help with the following problem. I have a dbgrid, the underlying query is filtered. I want to apply a new filter but stay at the same row number in the dbgrid. Here is my code:
with qrProperties do
begin
...
MyPoint:=GetBookmark;
Filter:='N<>'+IntToStr(ResultPropertyN);
Filtered:=True;
GotoBookmark(MyPoint);
end;
When it gets executed, an EDBEngineError is raised with a message "Could not find record". My explanation is that the bookmark functions do not take into account the filter and the procedure GotoBookmark searches for a record that is not present in the dbgrid (due to the filter applied). Is there any way to use bookmarks with filters?
Here are a little more details. In my application when I double click on a row in the dbgrid, it disappears (due to the filter applied) but as a result of the filtering the cursor moves to the first row (if I do not use bookmarks). I want it to stay at the same row number that is to go to the record shown immediately after the one that has been deleted.