Make sure that you are drinking ENOUGH, since water retention will occur if you are not drinking enough as well.
Consuming a lot of carbohydrates can also cause water retention, since for every gram of carbohydrates consumed, your body holds 3 grams of water - that's not to say eliminate carbohydrates, but be sensible with them, and be aware that that can happen with them.
Bloating can also be caused from gas build-up in your system, poorly digested food, etc. Consuming foods that you have sensitivities or intolerances to can also cause bloating (and water retention), so if you're eating anything that doesn't agree with you, it could be causing this.
You really need to eliminate the cause of the bloating if it such an issue, and unless you know for sure that something is doing it, you will have to find it out by process of elimination, and you do that by experimenting with different things.