I was a cramposaurus-rex for years.
Then I discovered Hammer Nutrition stuff.
Best. Stuff. Ever.
Their Endurolytes, HEED, and Perpeteum are the greatest anti-cramping products I've ever tried. This weekend I did the hardest riding I've ever done with hardly a sign of a cramp. The formula for success was lots of Endurolytes (3 the night prior, 3 first thing in the morning, and two doses of 3 pills during the race). One bottle of 3 scoops HEED, two bottles with 2 scoops of Perpeteum. 90+ degrees out, massive climbs, and general suck. No cramps.
I'm not paid by Hammer or anything

Their stuff just kicks ass.