Hi,
First, I have an EditableRootCollection of users. I show that on a readonly grid and when i double click a row a modal form opens up to edit the specific user.
i think have read all the correct ways to save if you are using windows data binding...IE: apply changes via the binding source object. But when i call EndEdit, and i have a break point on my user dataportal_update method, and that get's called...This is before i hit the clone line of code.
Any one else experiencing this? Am i doing this correctly with EditRootCollection?
Thanks for any help
Private Sub Save()
bindingSource.RaiseListChangedEvents = False
bindingSource.EndEdit() <- - this calls the Save on the object, and thus the dataportal_update method
Dim temp As User = mUser.Clone
Try
mUser = temp.Save
Catch ex As Exception
Throw
Finally bindingSource.RaiseListChangedEvents = TrueUpdate:
Ok, after stepping through the code, this is what happens:
1) When you call EndEdit on binding source, that ends up calling AcceptChangesComplete on the businessbase (core)
2) This ends up doing a check to see if parent is something and if so calls parent.ApplyEditChild.
3) So if parent is EditableRootListBase, then SaveItem is called from ApplyEditChild.
4) SaveItem calls this code: Me.Item(index) = DirectCast(item.Save, T). Note the Save. This calls dataportal_update.
So, the question is: Am I doing this correctly? How should I present the EditableRootListBase collection in the UI? Or should I?
Thanks again.
Copyright (c) Marimer LLC