code: def make_grid_frame(self, event):
          
          if self.grid_frame:
              print('-I- You already have a grid frame open')
              pw.simple_warning("You already have a grid open")
              return
  
          try:
              grid_type = event.GetButtonObj().Name[:-4] # remove '_btn'
          except AttributeError:
              grid_type = self.FindWindowById(event.Id).Name[:-4] # remove ('_btn')
          wait = wx.BusyInfo('Making {} grid, please wait...'.format(grid_type))
          wx.SafeYield()
          # hide mainframe
          self.on_open_grid_frame()
          self.grid_frame = grid_frame.GridFrame(self.er_magic, self.WD, grid_type, grid_type, self.panel)
          if self.validation_mode:
              if grid_type in self.validation_mode:
                  self.grid_frame.grid.paint_invalid_cells(self.warn_dict[grid_type])
                  #self.grid_frame.msg_boxsizer
                  current_label = self.grid_frame.msg_text.GetLabel()
                  add_text = """\n\nColumns and rows with problem data have been highlighted in blue.
  Cells with problem data are highlighted with different colors according to the type of problem.
  Red: missing required data
  Green: missing or invalid parent
  Blue: non-numeric data provided in a numeric field
  Gray: unrecognized column
  Purple: invalid result child
  Yellow: Out-of-range latitude (should be -90 - 90) or longitude (should be 0-360)
  Light gray: Unrecognized term in controlled vocabulary
  
  Note: It is possible to have a row highlighted that has no highlighted column.
  This means that you are missing information higher up in the data.
  For example: a specimen could be missing a site name.
  However, you need to fix this in the sample grid, not the specimen grid.
  Once each item in the data has its proper parent, validations will be correct.
  """
                  self.grid_frame.msg_text.SetLabel(add_text)
          #self.on_finish_change_dir(self.change_dir_dialog)
          del wait
docs: Create a GridFrame for data type of the button that was clicked