If you are using the default template grid, and the data source is from database or XPath, you have the option to 'wait for search' on the data source tab. You have to set the 'Show Search Bar' to 'Always' for this option to appear, but it sounds like this accomplishes what you want. This may achieve what you are looking for without using a custom widget
I'm not sure exactly what widget you are using, but you can accomplish this if it has "on change" or "on leave" event. You can create a boolean value that will be used to show the visibility of the template grid. Use conditional visibility on the template grid to only show if the boolean value is true. In the widget, use an on change or on leave event, to trigger a microflow that sets the boolean value to "true", which will display the template grid (make sure to use refresh in client for the change activity).
Another alternative would to try and leverage conditional visibility based on an expression.
The CSS you'll need to hide the "always" shown Mendix search bar:
Then simply add the class 'hide-search' to your TemplateGrid.