I have an ERL bound to a DataGridView. I can modify any row once and have the update take. I can also add a row and have it save. Deletes work fine. My problem comes in when I try to modify a row that has already been saved once. All additional updates do not get fired.
I've looked through the post and found one related to this, but I couldn't figure out how to implement the suggestion. Rocky posted that I would have to handle the ListChanged event and raise the PropertyHasChanged in the root object.
If anyone has any help, I would appreciate it.
stan
I've tracked the issue down to BusinessBase.AcceptChangesComplete. The first time an item is updated, it's parent is the ERL. The next time through it has no parent. This makes some sense because the save actually retuns a new object (although I don't know why it would lose its reference to the parent).
I do not mark my BusinessBase objects as children (I haven't looked, but I guess the add method for the ERL does it). If I do add MarkAsChild, then I cannot call MyBase.Save.
This could be a bug. Are you using a remote data portal configuration?
I am using a remote data portal. I've been trying to step through to see where I lose the parent, and I can't track it down. When it gets to the DP_U, it doesn't have the reference to the parent at that point, but it appears to be back after the call. And a light goes off, I was checking the parent of the object making the call and not the returned object. I was checking in the Save of the BO.
So it seems, it is losing the reference when it crosses te data portal.
Any ideas?
Yes, definitely a bug in ERLB. The following code is missing:
''' <summary>
''' Replaces an
item in the list.
''' </summary>
''' <param name="index">Index at which the item was replaced.</param>
''' <param name="item">New item.</param>
Protected Overrides Sub
SetItem(ByVal index As
Integer, ByVal
item As T)
item.SetParent(Me)
MyBase.SetItem(index,
item)
End Sub
Add that and the problem should be resolved – I’ll
fix it in 3.0.2.
Rocky
From: stanc
[mailto:cslanet@lhotka.net]
Sent: Wednesday, August 08, 2007 11:43 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Datagrid Second Update
I am using a remote data portal. I've been trying to step through to see
where I lose the parent, and I can't track it down. When it gets to the DP_U,
it doesn't have the reference to the parent at that point, but it appears to be
back after the call. And a light goes off, I was checking the parent of the
object making the call and not the returned object. I was checking in the Save
of the BO.
So it seems, it is losing the reference when it crosses te data portal.
Any ideas?
great work! That one was bugging me too
Copyright (c) Marimer LLC