Those could be caused by a loose display cable, a failing display cable, a failing monitor, or a failing GPU.
You can test the monitor by observing whether the grid lines obstruct/go through the OSD (when you press the menu button) If the lines are only around the OSD, your monitor is probably fine. Other than that, the only way that I know to test which is by swapping them out one at a time until things work again.
It's also possible that you have some program running that just displays the grid lines, but I've never heard of such a thing.