Loading the grid from the database