Paint Before Floors?
Normally, I would say the floors would come last. So any paint work would not be able to get on the fresh floors. Kinda a top down theory. However. not knowing what it is going to take for your floors (you were asking about grinding) I am somewhat hesitant to tell you to paint first. I could image the dirt and debris from such a grinding procedure making the fresh paint oh, not so fresh. So both ways have there pros and cons.
Hope my input was of some help.