This example covers a situation when an end-user fills DetailView information in batch mode. Sometimes it's necessary to duplicate last entered items into a new DetailView form.
For implementation details, please refer to the platform-independent NewValuesController class (see the NewObjectInit.Module project).
Basically, the current object is saved when the Save and New action is executed. After a new DetailView is initialized, the new object is updated using the previous object details.
Question Comments
Added By: Khaled Abdo at: 1/7/2013 5:31:25 PM
Exception when object has Lookup object.
--------------
Exception occurs while assigning the 'DetailView, ID:Person_DetailView' view to WinWindow:
The 'DevExpress.Persistent.BaseImpl.Address' object belongs to a different session.
Hello,
I already found the solution.
........modify code to be like below........
Person current = (Person)View.CurrentObject;
Address addressObjectByKey = current.Session.GetObjectByKey<Address>(person.Address1.Oid); ;
current.Address1 = addressObjectByKey;
current.FirstName = person.FirstName;
........
DevExpress are the best ^_^
You can find a variant of this implementation configurable from application model in www.expandframework.com v13.1.5.16 and later. (see also http://goo.gl/694UOG)