Selecting records in grid after applying filter on the grid.

There is select all option in my form to select all records in form. It is woking fine if i do not apply any filter on the grid. But after applying filter it should select only filtered records instead it is selecting all the records. For this i need to get the query after applying filter. Please can anyone of you suggest me how to do that??

Please see this thread - it shows how to get form query including user filters.

The thread is named Getting user filter values from a grid and it’s less than a week old - you should use Search function to avoid duplicate questions.