You could place your datagrid inside of a helper object dataview. In this dataview you can show search options (Attributes on your helper object). Your datasource microflow can now use this object as input to do custom retrieves.
There is a widget for that: https://appstore.home.mendix.com/link/app/32075/Mendix/Data-Grid-Search-Filters
Regards,
Ronald