It is connected to diabetes... but you can also have "idiopathic" gastroparesis.
There are many things that can lead to gastroparesis. Taking narcotics, such as pain pills, for an extended amount of time can also contribute to gastroparesis. Certain procedures can trigger it as well.
They don't really know what causes it... at least that is what they tell my husband. He does not have diabetes and he has gastroparesis. They seem to think that it was the pain pills that his other dr. had him on for years for back pain.
There is no cure for gastroparesis, but there are treatments for it. Medications, surgery, and there is also a gastric stimulator that can be inserted.
You can read about the gastric stimulator at Medtronic.com
From my reading, it is most often associated with diabetes, and diabetes is hereditary.