When a non-persistent object contains a collection of persistent business objects, you may need to edit linked objects right in the list view either in in-place or in ListViewAndDetailView
mode. Also, if a linked persistent object is edited in a popup detail view, you may need to see changes in the source list view after they are saved.
This example demonstrates how you can perform these tasks in XAF applications.
Warning
We created this example for demonstration purposes and it is not intended to address all possible usage scenarios. If this example does not have certain functionality or you want to change its behavior, you can extend this example. This can be a complex task that requires good knowledge of XAF: UI Customization Categories by Skill Level, and you may need to research how our components work. Refer to the following help topic for more information: Debug DevExpress .NET Source Code with PDB Symbols. We are unable to help with such tasks as custom programming is outside our Support Service scope: Technical Support Scope.
- The NonPersistentObjectSpace created for the master object cannot handle linked persistent objects by default. To work with them, create a persistent object space and add it to the AdditionalObjectSpaces collection. Set NonPersistentObjectSpace.AutoDisposeAdditionalObjectSpaces to
true
to automatically dispose of additional object spaces when the master is disposed of. - Set NonPersistentObjectSpace.AutoCommitAdditionalObjectSpaces to
true
to automatically commit changes made to linked persistent objects. - Set NonPersistentObjectSpace.AutoRefreshAdditionalObjectSpaces to
true
and subscribe to the ObjectGetting event, to refresh linked persistent objects when the non-persistent object view is refreshed. In the event handler, create a new instance of the non-persistent object and get fresh copies of linked persistent objects. - This example uses the
Category
property to filter the nested list view of persistent objects. To avoid the object space modification when this property is changed, subscribe to the BaseObjectSpace.ModifiedChanging event and set thee.Cancel
parameter totrue
depending on other event arguments.
- How to implement CRUD operations for Non-Persistent Objects stored remotely in eXpressApp Framework
- How to edit Non-Persistent Objects nested in a Persistent Object
- How to: Display a List of Non-Persistent Objects
- How to filter and sort Non-Persistent Objects
- How to refresh Non-Persistent Objects and reload nested Persistent Objects
- How to edit a collection of Persistent Objects linked to a Non-Persistent Object
(you will be redirected to DevExpress.com to submit your response)