I dry hop in the keg only with whole hops. Pellets simply do not work, I tried it a million different ways. Pellets dissolve in beer, dye it green and make it cloudy. You can literally taste the green grassy leafs in-between your teeth. Bags and other things simply don't help.
No such problems with whole hops: simply throw some hops in a big nylon bag and let them float on the top. Whole hops in the keg work great.