implement statistics (record count) on grid and groupings