Cambridge Grammar of English: A Comprehensive Guide - It is comprehensive, as it says, and it comes with a useful CD-ROM. It's also filled with many examples. I sometimes have trouble finding what I'm looking for in it, even with the CD-ROM with its search facility. Also, it never seems to answer any questions - just gives lots of examples without saying 'how' or 'why' something is the way it is.
Grammar for English Language Teachers by Martin Parrott - I haven't actually read any of this yet. It seems to cover most things. As the title suggests, it's written for English language teachers and it gives good practical information about what students find difficult, and how to explain/teach things.
Grammar: A Student's Guide by James R. Hurford - This book is arranged like a dictionary - main grammatical words are arranged in alphabetical order - so I find it very easy to find something I'm looking for. Also, entries are cross-referenced within the book, making it even more easy to find out things. It is probably not as comprehensive as some others.
A Comprehensive Grammar of the English Language by Randolph Quirk et al. - I don't actually own this book, I have just seen it. This is probably the best grammar book in terms of covering everything there is to know about grammar. It's a hefty book, spanning almost 2,000 pages and it is extremely detailed. It is quite old, however, so it is a more traditional view of grammar, not really accounting for modern English usage, but using another more modern book (like Michael Swan's) would fix that. There's a good reason I don't own this book - the price tag. Anywhere from £90-£150 (R$260 - R$430) would be a good price.
I checked a couple of common Brazilian book websites, as the price of foreign books in Brazil is often higher - Livraria Cultura and Saraiva. Livraria Cultura doesn't have the Quirk book. Saraiva has the book for a cool R$577,00. I doubt you'll find it cheaper than $R300, and that would be importing it from somewhere else.