How does 麦 connect 烧麦 (shāomài), a kind of dumpling, with 大麦 (dàmài), 小麦 (xiǎomài), and 燕麦 (yànmài), which are types of grains?
It's nothing to do with 麦 (grains).

From wikipedia,


  烧卖，又称稍麦、烧麦、捎卖、稍美、干蒸、烧梅、肖米、鬼蓬头。
  
  烧卖及其他与之谐音的名称的来由有多种说法，没有定论。


It's explained a little in the English version.


  The name was given "捎卖", meaning the product was "sold as a sideline", with tea.
  
  The name was later transformed into modern forms like "烧麦", "稍美" and "烧卖", changing the characters while keeping the original pronunciation.