update to only reload datagrid if the grid is visible