Do it well before to give the paint plenty of time to dry. If you don't want to take up the carpet due to exposing the gripper rods, that can be very dangerous going up and down stairs, also deadly for pets paws, ( if you have a pet) do as I do, get a good sharp Stanley knife and cut a three inch boarder of carpet away from skirting, and stair wells, give a good hoover, and paint. You then still have carpet down in the main areas, and no problem with exposed gripper rods.