I have an ASP .net C# project using a EntityDataSource with a DevExpress aspxGridView and it is working great allowing me to select, update, insert and delete. However I would like to use a custom delete method instead which basically just does an update instead (just setting an active flag to false) rather than a real delete.
I have a feeling I need to use the entitydatasource’s or the grids onrowdeleting event but this is my first project with Entity Framework 4.0 so still finding my feet. I have no idea if I need to create an overrides update method in the edmx code behind file.
Greatly appreciate any help.
You can register a handler on the SavingChanges event to perform wat you want.
something like this:
http://msdn.microsoft.com/en-us/library/cc716714.aspx
OR You can map a Stored Procedure to perform your delete the way you want.
http://learnentityframework.com/LearnEntityFramework/tutorials/using-stored-procedures-for-insert-update-amp-delete-in-an-entity-data-model/
I like better the second option…