SelectList with SelectListGroup
<p>I'm trying to return a <code>SelectList</code> with <code>&lt;optgroup&gt;</code>'s using <code>SelectListGroup</code>, but the code below only returns the values in the SelectList without the groups. How can I have my select list separated by groups?</p>

<pre><code>public SelectList MyList()
{
   var group1 = new SelectListGroup() { Name = "Group 1" };
   var group2 = new SelectListGroup() { Name = "Group 2" };

   var items = new List&lt;SelectListItem&gt;();

   items.Add(new SelectListItem() { Value = "1", Text = "Item 1", Group = group1 });
   items.Add(new SelectListItem() { Value = "2", Text = "Item 2", Group = group2 });

   return new SelectList(items, "Value", "Text");
}
</code></pre>