I once installed grips using hair spray and they never loosened for the the 10 years that I owned that bike. These were not heated grips. On one of my ST1100's I installed heated grips. The manufacturer recommended two-part epoxy. This is what I used and I never had a problem with those grips coming loose either. This manufacturer stressed the importance of using higher temperature rated epoxy over other types of adhesives/sealants for heated grips. They stated that the heat can soften these adhesives and allow the grips to move.
"EPOXY: We recommend only slow curing (generally considered 6+ hours, or overnight) two-part epoxy because it is usually rated at 250 degrees F. The quicker curing epoxy is generally rated at 200 degrees F or lower. Do NOT use other types of adhesives. Do NOT use silicone sealant, crazy glue, superglue, other superglue, other cyanoacrylate adhesives, weather-strip adhesives, or anything else. Just use two-part epoxy of the type we recommend. There are many brands out there, and some of them are DURO, DEVCON, JB WELD, BORDEN, etc. Most are available at auto parts stores, hardware stores, and often found in “Big Box Store” hardware or automotive departments. (The reason we do not want you to use anything other than epoxy is because of the temperature these grips may reach in service, and because other types of adhesives rely on solvent evaporation, which may take a very long time. Most other adhesives will soften with elevated temperatures, and you don't want these grips to loosen while riding.)"