Grid doesnt line up in cubase 8.5 pro

I have a problem with the grid not lining up with tempo,the recorded midi track is in sync with click,tempo and time
Signiture but not the grid?