title: Model with collection - Html.ListBoxFor doesn't set selected items
body: <p>This one is driving me crazy and before I loose my sane please help.</p>
  
  <p>Summary of the issue:
  My model "Thread" has collection of "ForumMessage", each ForumMessage has one Multi select drop down list. All I want to do is set the selected value based on values coming from Database. I have gone thru many threads but wasn't able to find the solution. </p>
  
  <p>In case if you are aware of any such question please let me know and I will go thru them.</p>
  
  <p>Below are my models</p>
  
  <pre><code>public class Thread
  {
      public List&lt;ForumMessage&gt; Messages { get; set; }
      //Master list coming from DB
      public List&lt;Classifications&gt; AllClassifications { get; set; }
      public string Subject { get; set; }
      public int[] ThreadSelectedClassifications { get; set; }
  }
  
  public class ForumMessage
  {
      public string MessageName { get; set; }
      public int[] SelectedClassifications { get; set; }
  }
  
  public class Classifications
  {
      public int ID { get; set; }
      public string Title { get; set; }
      public string Description { get; set; }
  }
  </code></pre>
  
  <p>Below is my controller</p>
  
  <pre><code>public ActionResult Index()
  {
      var thread = new Thread();
      thread.Messages = new List&lt;ForumMessage&gt;();
  
      thread.AllClassifications = new List&lt;Classifications&gt;() 
      { 
          new Classifications { ID = 1, Title = "One"   , Description = "One"   }, 
          new Classifications { ID = 2, Title = "Two"   , Description = "Two"   }, 
          new Classifications { ID = 3, Title = "Three" , Description = "Three" }, 
          new Classifications { ID = 4, Title = "Four"  , Description = "Four"  }, 
          new Classifications { ID = 5, Title = "Five"  , Description = "Five"  } 
      };
      thread.ThreadSelectedClassifications = new int[] { 2, 4 };
      for (int i = 0; i &lt; 5; i++)
      {
          var post = new ForumMessage();
          post.SelectedClassifications = new int[] { 2, 4 };
          post.MessageName = i.ToString();
          thread.Messages.Add(post);
      }
  
      return View(thread);    
  </code></pre>
  
  <p>Below is my view</p>
  
  <pre><code>@model MultiSelectDemo.Controllers.Thread
  @foreach (var item in Model.Messages)
  {
      &lt;div class="row"&gt;
          &lt;div class="col-md-4"&gt;
              @*@Doesn't set the items selected *@
              @Html.ListBoxFor(m =&gt; item.SelectedClassifications, new SelectList(Model.AllClassifications, "ID", "Title"));
          &lt;/div&gt;
  
          &lt;div class="col-md-4"&gt;
              @* Doesn't set the items selected  *@
              @Html.ListBoxFor(m =&gt; item.SelectedClassifications, new SelectList(Model.AllClassifications, "ID", "Title", item.SelectedClassifications));
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              @* Doesn't set the items selected  *@
              @Html.DropDownListFor(m =&gt; item.SelectedClassifications, new SelectList(Model.AllClassifications, "ID", "Title", item.SelectedClassifications), new { @multiple = "multiple" })
          &lt;/div&gt;
      &lt;/div&gt;
  }
  &lt;hr /&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-md-12"&gt;
          This works.
          @Html.ListBoxFor(m =&gt; m.ThreadSelectedClassifications, new MultiSelectList(Model.AllClassifications, "ID", "Title"))
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2rNZa.png" alt="Sample Output">}    </p>