This is a migrated thread and some comments may be shown as answers.

Best approach for save/cancel when using ADO.NET Entity

4 Answers 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 21 Jul 2010, 11:13 PM
I tried  this.domainDataSource.SubmitChanges();

 

 

when save is clicked, it works for edits, but not deletes. 
The deleting is being done with  ICommand deleteCommand = RadGridViewCommands.Delete;

 

 

 

 

 

Which is tied to a button.
Is there a command to commit all changes, including adds and deletes?

While on the subject does anyone have a solution to prevent the user from navigating away from the page while there are uncommitted edits/deletes without a warning?

4 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 22 Jul 2010, 11:57 AM
Hi Andrew,

 DomainDataSource.SubmitChanges() should send to the server all adds, edits, deletes, etc. Could you please send a sample application that demonstrates this problem?

Regarding your second point, the key is the HasChanges property of the DomainDataSource. If you're using Silverlight navigation, you need to handle the Navigating event of your Frame, and cancel it if the HasChanges property is set to true. Alternatively, you can handle the onbeforeunload event of the HTML page that contains your Silverlight control and again return false if the HasChanges property equals true.

Regards,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 22 Jul 2010, 02:17 PM
This is the error I am getting, any idea what it means?  I only get it if I execute my save command when I have deleted a row.

An unhandled exception ('Unhandled Error in Silverlight Application
Code:4004
Category: ManagedRuntimeErrror
Message: System.ServiceModel.DomainServices.Client.DomainException:
And error occured while submitting changes on the DomainContext of type
and that is all I can see in the popup which then wants to start a new debugger.

I am new to this, so I am not clear what code I need to add to capture the exception so we can get better debugging information.
0
Yavor Georgiev
Telerik team
answered on 22 Jul 2010, 02:31 PM
Hello Andrew,

 Could you please open a support ticket and send us your solution?

Greetings,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 22 Jul 2010, 02:39 PM
OK I am doing so right now under datagrid.
Tags
GridView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or