code: def OnColSize(self, event):
          
  
          col = event.GetRowOrCol()
          tab = self.grid.current_table
          colsize = self.grid.GetColSize(col) / self.grid.grid_renderer.zoom
  
          # Detect for resizing group of cols
          cols = self.grid.GetSelectedCols()
          if len(cols) == 0:
              cols = [col, ]
  
          # Detect for selection of rows spanning all columns
          selection = self.grid.selection
          num_rows = self.grid.code_array.shape[0]-1
          for box in zip(selection.block_tl, selection.block_br):
              top_row = box[0][0]
              bottom_row = box[1][0]
              if top_row == 0 and bottom_row == num_rows:
                  cols += range(box[0][1], box[1][1]+1)
  
          # All column resizing is undone in one click
          with undo.group(_("Resize Columns")):
              for col in cols:
                  self.grid.code_array.set_col_width(col, tab, colsize)
                  zoomed_colsize = colsize * self.grid.grid_renderer.zoom
                  self.grid.SetColSize(col, zoomed_colsize)
  
          # Mark content as changed
          post_command_event(self.grid.main_window, self.grid.ContentChangedMsg)
  
          event.Skip()
          self.grid.ForceRefresh()
docs: Column size event handler