title: ASPxGridView and LinqServerModeDataSource, inserting rows by stored procedure
body: <p>I have a page using ASPxGridView and to fill the GridView I use a LinqServerModeDataSource control who fetches it data through a SQL View from a MS SQL Server. So far so good but here comes the problem.</p>
  
  <p>I want to insert data in the database so I'm building a custom form </p>
  
  <pre><code>&lt;Templates&gt;
      &lt;EditForm&gt;
          Company Name: &lt;dx:ASPxTextBox ID="CompanyName" runat="server" /&gt;
          Company Mail: &lt;dx:ASPxTextBox ID="Email" runat="server" /&gt;
  
          &lt;dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton" runat="server" /&gt;
          &lt;dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton" runat="server" /&gt;
  
      &lt;/EditForm&gt;
  &lt;/Templates&gt;
  </code></pre>
  
  <p>Here is an example of the custom form</p>
  
  <p><img src="https://i.stack.imgur.com/mwZed.png" alt="Example"></p>
  
  <p>Pretty basic stuff, in this scenario the Company name goes to one table and the email to another. This is all handled by calling a Stored Procedure. Or thats the plan. </p>
  
  <p>Does anyone know how to do this?</p>
  
  <p>It feels like I've been trying it all, LinqServerModeDataSource1_Inserting, ASPxGridView1_RowInserting and so on but nooo. Here is one of the failing codes. And the devexpress documentation is even worse, but lets not go there its not a happy place.</p>
  
  <pre><code>protected void LinqServerModeDataSource1_Inserting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceEditEventArgs e)
  {
      // Some magic to insert data here
      ASPxGridView1.CancelEdit();
  }
  </code></pre>
  
  <p>So, any advice or help is highly appreciated.</p>
  
  <p>Thanks! </p>