OnCellClick:
if (...) then
  StringGrid.Options := StringGrid.Options + [goEdting]
else
  StringGrid.Options := StringGrid.Options - [goEdting];