Hi Nancy! well, If you like to enjoy romantic rain in the mountains, then July is perfect time to visit dharamshala. You can witness Hills at their greenest and Waterfalls at their fullest. Otheriwse, march to Mid-july is considered to be the best time to visit Dharamshala due to scenic trails and fully blossomed flowers in the valley, without rains or freezing snow.
There might be chances that heavy rainfall might happen, which sometimes also result into Landslides. But it is not dangerous if you're cautious on few things such as Avoiding driving while raining or after sunset. Carrying Rain wear with boots with good grip.