docstr: Bind to intercept events on the grid
  
  Binds on_mouse_motion and on_column_resize in order to do tooltips.
  Sets up editing / auto size and other to customize for table type.
docstr_tok: ["Bind","to","intercept","events","on","the","grid","Binds","on_mouse_motion","and","on_column_resize","in","order","to","do","tooltips",".","Sets","up","editing","\/","auto","size","and","other","to","customize","for","table","type","."]
code: def bind_to_grid(self, grid):
      """Bind to intercept events on the grid
  
      Binds on_mouse_motion and on_column_resize in order to do tooltips.
      Sets up editing / auto size and other to customize for table type.
      """
      self.grid = grid
      grid.AutoSize()
      grid.EnableEditing(False)
      grid.SetDefaultCellOverflow(False)
      if self.v.corner_button is None:
          grid.fn_clicked = None
      else:
          fn_clicked = self.v.corner_button["fn_clicked"]
  
          def on_corner_button_clicked(e):
              fn_clicked(e)
              self.update_grid()
              grid.ForceRefresh()
              grid.Parent.Layout()
  
          grid.fn_clicked = on_corner_button_clicked
          grid.label = self.v.corner_button.get("label", "Update")
          grid.tooltip = self.v.corner_button.get("tooltip", "")
      #
      # Below largely taken from
      # http://wiki.wxpython.org/wxGrid%20ToolTips
      #
      self.last_pos = (None, None)
      grid.GetGridWindow().Bind(wx.EVT_MOTION, self.on_mouse_motion)
      grid.Bind(wx.grid.EVT_GRID_COL_SIZE, self.on_column_resize)
  
imports: import wx
  import wx.grid
  from cellprofiler_core.preferences import get_error_color
  from cellprofiler_core.setting import Table
label_desc: Use image node_id 2 for calling the TableController obj's underlying member method code with example usage: obj.bind_to_grid(grid) without return types