code: def delete(self):
          
  
          if self.grid.IsSelection():
              # Delete selection
              self.grid.actions.delete_selection()
  
          else:
              # Delete cell at cursor
              cursor = self.grid.actions.cursor
              self.grid.actions.delete_cell(cursor)
  
          # Update grid
          self.grid.ForceRefresh()
docs: Deletes a selection if any else deletes the cursor cell
  
          Refreshes grid after deletion