In 2.79 Floor grid hides automatically when doing viewport renders, but stayed in place for solid view.
How can I obtain such behaviour in 2.8? Manual unchecking Floor from Overlays is a bit annoying
It's not automatic but I've spent a good amount of time searching for this myself and found out that you can toggle on/off all overlays (grid, outlines, etc) by clicking the overlay icon.
I know this is pretty late but I figured I'd post this in case. It's still annoying but it's better than having to uncheck/check each overlay.
If you want to hide only the grids, but keep other overlays, you can expand the Overlay Icon and uncheck Grid, Floor and Axis :
2.8+
. I don't know of any setting that allows to do that either. You're going to have to hide the grid floor manually like in one of the two answers. $\endgroup$