def METHOD_NAME(self):
    """Update the grid after the table data has changed"""
    need_column_layout = False
    grid = self.grid
    v = self.v
    if len(v.column_names) < grid.GetNumberCols():
        tm = wx.grid.GridTableMessage(
            grid.Table,
            wx.grid.GRIDTABLE_NOTIFY_COLS_DELETED,
            0,
            grid.GetNumberCols() - len(v.column_names),
        )
        grid.ProcessTableMessage(tm)
        need_column_layout = True
    elif grid.GetNumberCols() < len(v.column_names):
        tm = wx.grid.GridTableMessage(
            grid.Table,
            wx.grid.GRIDTABLE_NOTIFY_COLS_INSERTED,
            0,
            len(v.column_names) - grid.GetNumberCols(),
        )
        grid.ProcessTableMessage(tm)
        need_column_layout = True
    if len(v.data) < grid.GetNumberRows():
        tm = wx.grid.GridTableMessage(
            grid.Table,
            wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED,
            0,
            grid.GetNumberRows() - len(v.data),
        )
        grid.ProcessTableMessage(tm)
    elif grid.GetNumberRows() < len(v.data):
        tm = wx.grid.GridTableMessage(
            grid.Table,
            wx.grid.GRIDTABLE_NOTIFY_ROWS_INSERTED,
            0,
            len(v.data) - grid.GetNumberRows(),
        )
        grid.ProcessTableMessage(tm)
    if need_column_layout:
        grid.AutoSizeColumns()