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.
I want to insert data in the database so I'm building a custom form
<Templates>
<EditForm>
Company Name: <dx:ASPxTextBox ID="CompanyName" runat="server" />
Company Mail: <dx:ASPxTextBox ID="Email" runat="server" />
<dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton" runat="server" />
<dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton" runat="server" />
</EditForm>
</Templates>
Here is an example of the custom form
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.
Does anyone know how to do this?
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.
protected void LinqServerModeDataSource1_Inserting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceEditEventArgs e)
{
// Some magic to insert data here
ASPxGridView1.CancelEdit();
}
So, any advice or help is highly appreciated.
Thanks!
"I want to insert data in the database so I'm building a custom form" ASPxGridView can do all that for you without you having to make a custom template at least with sqldb If i would define a delete command and or edit command below to the sqldatasource i could already delete and edit the information in the gridview
But you can if you really want to use a custom made insert or delete
That's how i did it last time. I made use of datatables and stored that in sessions bla bla realy just trying out but it works alright.