grammatically OK?

  1. The girl persisted to purchase that dress.
  2. The girl persisted purchasing that dress.
  3. The girl persisted in purchasing that dress.
    Are all these sentences grammatically OK?

No.3 is the one acceptable and formal, for the word ‘persist’ takes the preposition ‘in’.

No. 3 is the only one acceptable in any situation, not just formal situations.