When grinding, is it ok to have an erection or not. The answer to this question has eluded me greatly.
Yes, it is perfectly fine. The girl knows that the dancing position is sexual and has sexual intentions. With that said, it is a kind of compliment to them.
What I would do though, is make sure you are actually being sexually arousing back to her; when you grind, your hands should move from her lower back / hip down to her inner thigh, to suggest things to her to get her aroused too.
You should also escalate to an area / position where you can start making-out / progressing. Too long of dancing like that will make her feel a little creeped out, since you aren't doing anything with your boner and what not.