handle subgrid and pagination