Are you looking to grow clumping or running bamboo? If you want to plant bamboo near a fence I would suggest avoiding running bamboo as its underground rhizomes can go under fences and pop up everywhere. Clumping bamboos have a very short root structure and would be a better choice, however, it needs a wide berth of several feet to grow and should be planted at some distance away from your fence.
Bamboo may not be the right choice for planting in an area you do not want plants spreading. The roots will run and spread.
Bamboo can be difficult to keep under control.
Here is a few links for you to read.