title: Populating multiselect list with data MVC 3 .NET
body: <p>I have been searching a lot on Google and Stackoverflow for soltuions on how to Populate a Multiselect box with values that can be selected. But no luck.</p>
  
  <pre><code>public class PriceObj
  {
      public int ID { get; set; }
      public decimal Price { get; set; }
      public string Name { get; set; }
      public string Description { get; set; }
      public virtual ICollection&lt;PriceGroupObj&gt; PriceGroup {get; set;}
  }
  
  public class PriceGroupObj
  {
     public int ID { get; set; }
     public string Name { get; set; }
  }
  
  
  public class PriceDatabaseContext : DbContext
  {
      public DbSet&lt;PriceObj&gt; PriceObjs { get; set; }
      public DbSet&lt;PriceGroupObj&gt; PriceGroupObjs { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          base.OnModelCreating(modelBuilder);
          modelBuilder.Conventions.Remove&lt;System.Data.Entity.ModelConfiguration.Conventions.PluralizingTableNameConvention&gt;();
  
          modelBuilder.Entity&lt;PriceObj&gt;()
              .HasMany(g =&gt; g.PriceGroup)
              .WithMany()
              .Map(t =&gt; t.MapLeftKey("GroupID").MapRightKey("PriceID").ToTable("PriceGroup"));
      }
  
  
  }
  </code></pre>
  
  <p>Then I want in to be able to choose all appropriated price groups for a price in the edit view of the price objects. But I do not get it working, it is not populating all the already created groups in the MultiSelect box.</p>
  
  <p>This is the code I am using in the Razor veiw:</p>
  
  <pre><code>@Html.ListBoxFor(model =&gt; model.PriceGroup, Model.PriceGroup.Select(pg =&gt; new SelectListItem { Text = pg.Name, Value = pg.ID.ToString() }), new { Multiple = "multiple" })
  </code></pre>
  
  <p>The select element shows up on the website, but no values are to select from.</p>
  
  <p>Please help me sort out, where my chain is falling of.</p>