Well, we've BDTD with my son for 2 years now. He started with terrible constipation at 6 months and it is still a problem. However, now he seems to get constipated from holding the poop in, rather than from diet. (Dairy did contribute early on but since it is now a smaller part of his diet that isn't the problem.) Just holding poop in alone can cause constipation because with time fluid leaves the poop and it becomes increasingly large and hard. It is so hard to see them in pain and cranky from intentionally not pooping (even if they don't understand the consequences).
I am now in the process of tapering my son off the constipation medicine that he has been on and off (mostly on) for almost 2 years. He is finally old enough at 2 1/2 that I can at least talk to him about the need to poop every day, push out the poopies, feel better after pooping, etc. I don't think he totally gets it yet. Hoever, lately he seems to understand a little better.
Things that help:
1. Juice followed by water. The sugars in juice help draw fluid into the bowel, thus keeping stools soft. Lots of water helps too, but juice is better.
2. Oil on the bottom. If my son is straining to poop I rub his backside and the edge of his anus with oil. This helps the skin stretch and is soothing.
3. Running, playing, etc.
4. Lots of verbal encouragement.
5. Anything that they will eat that is nonconstipating: grapes, raisins, oatmeal, flaxmeal (can be cooked and doctored up like oatmeal), juice, crackling oatbran (very popular cereal in our house - tasty and packed with fiber. Good for a snack or meal), etc. etc.
6. Warm shower and encouragement to poop in the shower. THis has worked a few times for us - shower + oil on the pooper + hugs and encouragement in the shower.
7. He cries and shakes when he tries to make a big poop. I hug him and comfort him a lot at these times.
8. A lot of happy hugs, words, etc. when the deed is finally accomplished.
I'll let him go for a week or so unless he is crying and in terrible discomfort - then it is time for an enema. As much as he hates getting one they are very effective and he feels so much better afterwards.