I have a project using linq
to sql query at runtime to retrieved data
to datagrid view It works and function fine but can not save to database ro
delete to database. Do you have a simple program to show me how to do that in
wincontrol?
We have closed this ticket because another page addresses its subject:
How to make sure that all modifications are savedHow to save changes made in the GridControl in the LINQ to SQL database
Answers approved by DevExpress Support
Hi Farhad,
You want to save the data source changes made via our GridControl, right?
If so, refer to the following help article which contains all necessary information of how to accomplish this task:
How to Make Sure That All Modifications Are Saved
The main idea is to use the database's standard methods to save changes.
Using LINQ to SQL, the DataContext.SubmitChanges method serves for this purpose (refer to the How to: Submit Changes to the Database MSDN article for more information).
I suggest that you call this method in the GridView.RowUpdated event handler. Or choose another moment to save changes. For example, create a Save button and use its OnClick event handler for this purpose. Note that in this case it is necessary to call the PostEditor and UpdateCurrentRow methods as it is described at Posting Data to a Connected Database.
A similar issue has already been discussed in the how can i save changes from the GridControl to database thread.
Should you have further questions, feel free to contact us.