Event handler for grid resizing

def OnResizeGrid(self, event):
        """Event handler for grid resizing"""

        shape = min(event.shape[2], 2**30)
        self.SetItemCount(shape)
        event.Skip()