Added grid collection and reuse of MainGrid if the grids are equal
p4#: 20517