title: GridView with ObjectDatasource UpdateMethod
body: <p>I have an ASP.NET WebForms page containing an <code>ASPxGridView</code> and an <code>ObjectDataSource</code>:</p>
  
  <pre><code>&lt;dx:ASPxGridView ID="gvEmployees" runat="server"
      AutoGenerateColumns="False" DataSourceID="objDsEmployees"
      KeyFieldName="EmployeeId"&gt;
      &lt;Columns&gt;
          &lt;dx:GridViewCommandColumn VisibleIndex="0"&gt;
              &lt;EditButton Visible="True" /&gt;
          &lt;/dx:GridViewCommandColumn&gt;
          &lt;dx:GridViewDataTextColumn FieldName="EmployeeId" VisibleIndex="1" /&gt;
          &lt;dx:GridViewDataTextColumn FieldName="Name" VisibleIndex="2" /&gt;
          &lt;dx:GridViewDataTextColumn FieldName="Email" VisibleIndex="3" /&gt;
          &lt;dx:GridViewDataTextColumn FieldName="Telephone" VisibleIndex="5" /&gt;
      &lt;/Columns&gt;
  &lt;/dx:ASPxGridView&gt;
  &lt;asp:ObjectDataSource ID="objDsEmployees"
      runat="server"
      ConflictDetection="CompareAllValues"
      DataObjectTypeName="MySite.Data.Models.Employee"
      DeleteMethod="Delete"
      OldValuesParameterFormatString="original{0}"
      InsertMethod="Insert"
      SelectMethod="GetAll"
      TypeName="MySite.Services.EmployeeService"
      UpdateMethod="Update" /&gt;
  </code></pre>
  
  <p>The Employee model contains the following properties:</p>
  
  <pre><code>public class Employee
  {
      public int EmployeeId { get; set; }
  
      public string Name { get; set; }
  
      public string Email { get;
  
      public string Password { get; set; }
  
      public string Telephone { get; set; }
  }
  </code></pre>
  
  <p>The <code>ObjectDataSource</code> calls the <code>Update</code> method in the service layer:</p>
  
  <pre><code>public void Update(Employee employee, Employee originalEmployee)
  {
      _db.Employees.Attach(originalEmployee);
      _db.Entry(originalEmployee).CurrentValues.SetValues(employee);
      _db.SaveChanges();
  }
  </code></pre>
  
  <p>When the <code>Update</code> method is called, the parameters <code>employee</code> and <code>originalEmployee</code> only contain the properties used as columns in the <code>ASPxGridView</code> and the other properties (<code>Password</code> for example) are null.</p>
  
  <p>Is there a way I can preserve these values somewhere?
  By the way, I use Entity Framework for data access and DevExpress for the GridView.</p>