Print Page | Close Window

Problem saving

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2261
Printed Date: 29-Jul-2026 at 6:11am


Topic: Problem saving
Posted By: alindzon
Subject: Problem saving
Date 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. 
 



Print Page | Close Window