Long (possibly tedious) response below:

I'm reviewing grammar and punctuation with my two classes of first-year university students this month, and it's been interesting to see what they know, and hear how they learned it. Approximately half claim to have had NO formal grammar training, while the rest can recall spending some time in elementary and middle school learning about parts of speech and basic punctuation. The interesting thing is that nearly all of them (these groups are largely first-language-English-speakers) have assimilated most of the major grammatical conventions and syntactical constructions that they need to know. There are lingering areas of difficulty--comma usage, and catching and correcting sentence fragments give them some trouble. But they can write grammatically-correct prose, even if they can't tell me the difference between an adjective and an adverb (another common difficulty), or distinguish between the subject and the object in the sentence.

The problem at the university level is that what they don't know can start to trip them up: they need to be able to edit their own academic writing, and as the ideas they're trying to express become more complex we often see a kind of regression where students make more frequent errors, but don't know how to identify and catch them. And if we just write "SF" or "pron ref unclear" it's unlikely they'll be able to self-correct.

Ideally, I think, grammar should be reviewed at each level (elementary, middle, high school) as students develop their writing and produce more complex prose texts. But--the crashing but--teaching grammar is really boring; the students' eyes literally glaze over as I explain dangling modifiers. So I think a lot of teachers avoid explicit grammar instruction.

I'm having good luck with online instruction for this. We're using both a proprietary and an open-access site for first-years. Each has piles of grammar exercises, and offers good advice and explanations as students proceed through diagnostic and development exercises. I suspect that online instruction will be more and more useful in this area.