title: MVC update list items
body: <p>Hi I have a view which displays <code>Invoices</code> and <code>InvoiceLines</code>.</p>
  
  <pre><code>@model VectorCheck.ViewModels.InvoiceViewModel
  @{
      ViewBag.Title = "Invoice Details";
  }
  
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/EditorHookup.js")" type="text/javascript"&gt;&lt;/script&gt;
  
  @using (Html.BeginForm())
  {
      @Html.ValidationSummary()
      &lt;fieldset&gt;
          &lt;legend&gt;Invoice&lt;/legend&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;th&gt;
                      Activity ID
                  &lt;/th&gt;
                  &lt;th&gt;
                      Invoice Line Amount
                  &lt;/th&gt;
                  &lt;th&gt;
                      Payment Type
                  &lt;/th&gt;
                  &lt;th&gt;
                      Note
                  &lt;/th&gt;
                  &lt;th&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                  &lt;/th&gt;
              &lt;/tr&gt;
                     @foreach (var item in Model.InvoiceLines) {
                          &lt;tr&gt;
                              &lt;td&gt;
                                  @Html.DisplayFor(modelItem =&gt; item.Activity.Descriptor)
                              &lt;/td&gt;
                              &lt;td&gt;
                                  @Html.DisplayFor(modelItem =&gt; item.Amount)
                              &lt;/td&gt;
                              &lt;td&gt;
                                  @Html.DisplayFor(modelItem =&gt; item.PaymentType.Name)
                              &lt;/td&gt;
                              &lt;td&gt;
                                  &lt;span&gt;Person:&lt;/span&gt;
                                  @Html.DropDownListFor(modelItem =&gt; item.PersonrId, Model.People as IDictionary&lt;string, IEnumerable&lt;SelectListItem&gt;&gt;, "--- Select ---")
                              &lt;/td&gt;
                              &lt;td&gt;
                                  &lt;input type="submit" value="Update" /&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
                     }
              }
          &lt;/table&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p>What I'm wanting is for each <code>InvoiceLine</code> without going to another screen to be able to change the value in the dropdown list for <code>Person</code>, click update and get this updated <code>InvoiceLine</code> in the controller where I can save it.</p>
  
  <p>However when I get to the controller the <code>InvoiceLine</code> does not contain the values.</p>
  
  <p>Controller method:</p>
  
  <pre><code>[HttpPost]
          public ActionResult EditInvoiceLine(InvoiceLine invoiceLine, int id)
          {
  
              return View(invoiceLine);
          }
  </code></pre>
  
  <p>Has anyone achieve anything like this on the same page or knows how to do it?</p>
  
  <p>No, I do not want to use jqgrid. I have other functionality which jqgrid isn't suitable for.</p>