How Aggrid filter data save to dataframe

I am currently utilizing an Aggrid run file to export filter data into a CSV file. However, I would prefer to save the filtered data into a DataFrame upon pressing a button. I would appreciate your guidance and the appropriate code to achieve this.