Issue in last row removal in Grid

We have migrated all the tables to Grid while migrating from Vaadin version 7 to 8.5. We are facing an issue in the removal of last row remaining in the Grid. though the DataProvider is empty, The grid continues to display the last row unless manually refreshed like pressing F5 or clicking on the header. I am using

grid.getDataProvider().refreshAll();

Also removing and re-providing the DataProvider . Still the issue is not resolved , this is present across our UI and the issue is consistent.

Anyone who has gone through this and fixed it please provide some pointers which would help us fix this issue.

Thanks in Advance