title: MVC 3 DropDownList displays multiple values on Edit page
body: <p>I'm using an enum to populate my DropDownList that works fine with a List and Create views but my Edit view loads duplicate values in the DropDownList. The duplicate values are only the selected value for the property meaning, if Rented was the value saved in the DB the DropDownList would show Rented selected, Available, and another Rented in the list. What I need to know is how to load a DropDownList that selects the value previously stored in the DB for the PropertyStatus enum without any duplicates?  </p>
  
  <p>Controler:</p>
  
  <pre><code>        public ActionResult Edit(int id)
      {
          Property property = db.Properties.Find(id);
  
          ViewBag.PropertyStatus = SetViewBagPropertyStatus();
          return View(property);
      }
  
      private IEnumerable&lt;SelectListItem&gt; SetViewBagPropertyStatus()
      {
          IEnumerable&lt;ePropStatus&gt; values = 
              Enum.GetValues(typeof(ePropStatus)).Cast&lt;ePropStatus&gt;();
  
              IEnumerable&lt;SelectListItem&gt; items =
               from value in values
               select new SelectListItem
               {
                   Text = value.ToString(),
                   Value = value.ToString()
               };
              return items; 
      }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>    public enum ePropStatus
      {
          Available ,
          Rented
      }
  
      public partial class Property
      {
           public int PropertyId { get; set; }
           public string PropName { get; set; }
           public string Address { get; set; }
           public string City { get; set; }
           public string State { get; set; }
           public string ZipCode { get; set; }
           public int SqFeet { get; set; }
           public int Bedrooms { get; set; }
           public int Bathrooms { get; set; }
           public int Garage { get; set; }
           public string Notes { get; set; }
           public ePropStatus PropertyStatus { get; set; }
      }
  </code></pre>
  
  <p>Edit View:</p>
  
  <pre><code>@Html.DropDownList("PropertyStatus", Model.PropertyStatus.ToString())
  </code></pre>