title: how to convert Enum to IEnumerable<SelectListItem>
body: <p><strong>UPDATE 1</strong></p>
  
  <p>I want to populate a <code>listboxfor</code> mvc helper to render list items in View. I don't know how to pass the second parameter to the helper, which accepts <code>IENumerableSelectListItem</code> <code>SelectionList</code>.</p>
  
  <pre><code> Html.ListBoxFor(model =&gt; model.SelectedDate, Model.DateList, new { })
  </code></pre>
  
  <p>I am having a property in my model class,</p>
  
  <pre><code>public IEnumerableSelectListItem  DateList { get; set; }
  </code></pre>
  
  <p>and somehow i need to populate <strong>DateList</strong> from my controller action method, which fills up all the other model properties and passes it to a partial view where i have the helper. DateList should be getting the values from an Enum DateListEnum</p>
  
  <p>Any ideas on how to go about doing this. Also let me know how do i ensure that a single list item is selected at a time...i am really new to all these..and its been quite some time i am working on this...but nothing came up so far....</p>
  
  <p>I am having below code in my controller action method,</p>
  
  <pre><code>model.DateList = getDateList();
  </code></pre>
  
  <p>which calls this method,</p>
  
  <pre><code>public IEnumerableSelectListItem getDateList()
  
  {
  
  IEnumerableSelectListItem  values = Enum.GetValues(typeof(DateListEnum));
  
   //this one doesn't work because of casting issues and this is where i want to convert Enum Values to  IEnumerableSelectListItem
  
  return values; 
  
   }
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>i have the listbox working and its displaying in the UI based upon below code</p>
  
  <pre><code>` IEnumerable&lt;SelectListItem&gt; values = Enum.GetNames(typeof(ColumnFormattingDateFormats)).Cast&lt;ColumnFormattingDateFormats&gt;().Select(p =&gt; new SelectListItem()
              {
                  Text = p.ToString(),
                  Value = ((int)p).ToString()
              }).ToList();`
  </code></pre>
  
  <p>But now i am having few other problems,</p>
  
  <p>the enum that i am using is </p>
  
  <pre><code>`public enum ColumnFormattingDateFormats : int 
  { 
  [StringValue("Wednesday, March 14, 2001")]
   FULLDATE = 0, 
  [StringValue("3/14")]
   MMDDWSLASH = 1,
   [StringValue("3/14/01")]
   MMDDYYWSLASH = 2,
   [StringValue("03/14/01")]
   MMDDYYWMMZEROPREFIXWSLASH = 3 
  }`
  </code></pre>
  
  <p>and my helper looks like this,</p>
  
  <p><code>Html.ListBoxFor(model =&gt; model.SelectedDate, Model.DateList, new { })</code></p>
  
  <p><strong>1> How do i pass the selected item to the listboxfor helper?</strong>
  is there a way to pass the selected item to the helper through the property
   <code>[DataMember]
   public ColumnFormattingDateFormats SelectedDate{ get; set; }</code>
   in my model class? to begin with i am passing
   <code>this.SelectedDate= ColumnFormattingDateFormats.FULLDATE;</code> 
  to the default constructor in my model class...but for some reason the first parameter <code>model =&gt; model.SelectedDate</code>has some problem with that..throws null exception... </p>
  
  <p><strong>2> how do i ensure <code>[StringValue]</code> from Enum gets displayed in UI listbox element and not the Enum Text for ex. FULLDATE should not be getting displayed, instead "Wednesday, March 14, 2001" should be?</strong></p>
  
  <p><strong>3> How do i ensure that a single item is selected without using livequery?</strong></p>
  
  <p>My brains are all fried up now....any directions anyone?????</p>