New Posts New Posts RSS Feed: Problem saving
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Problem saving

 Post Reply Post Reply
Author
alindzon View Drop Down
Newbie
Newbie
Avatar

Joined: 28-Jul-2010
Location: Toronto
Posts: 31
Post Options Post Options   Quote alindzon Quote  Post ReplyReply Direct Link To This Post Topic: Problem saving
    Posted: 25-Oct-2010 at 8:54pm
I am loading a child grid with data based on changing the current row on the parent grid.  It is working fine until an edit needs to be saved.  The code executed when the page is loaded, or the row is changed is

private void link_load(object sender)

{

var query = Global.mgr.ManufacturerLinks.Where(m => m.ManID == ((Ashlin.Model.Manufacturer)(((Telerik.Windows.Controls.DataControl)(sender)).CurrentItem)).ManID);

var op = query.ExecuteAsync();

op.Completed += (s, args) => linkgrid.ItemsSource = args.Results;

}

If attempting to save changes, the parent works fine but the child has this error.
Coded 4004
ManagedRunTimeError
EntityManagerSaveException: unable to update the EntitySet 'ManufacturerLinks' because it has a DefiningQuery and no...
 
If cancel is executed this code works perfectly

Global.mgr.ManufacturerLinks.EntityManager.RejectChanges();

The parent data is handled by a viewmodel and repository.  The child data is retrieved in the code behind using the code above.
 
It is my workaround since I am still unable to grasp passing arguments to a repository. 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down