[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Collapse]API Reference
  [Expand]DevExpress.EasyTest.Framework
  [Expand]DevExpress.ExpressApp
  [Expand]DevExpress.ExpressApp.Actions
  [Expand]DevExpress.ExpressApp.AuditTrail
  [Expand]DevExpress.ExpressApp.Chart
  [Expand]DevExpress.ExpressApp.Chart.Web
  [Expand]DevExpress.ExpressApp.Chart.Win
  [Expand]DevExpress.ExpressApp.CloneObject
  [Expand]DevExpress.ExpressApp.ConditionalAppearance
  [Expand]DevExpress.ExpressApp.Dashboards
  [Expand]DevExpress.ExpressApp.Dashboards.Web
  [Expand]DevExpress.ExpressApp.Dashboards.Win
  [Expand]DevExpress.ExpressApp.Data
  [Expand]DevExpress.ExpressApp.DC
  [Expand]DevExpress.ExpressApp.DC.ClassGeneration
  [Expand]DevExpress.ExpressApp.Editors
  [Expand]DevExpress.ExpressApp.EF
  [Expand]DevExpress.ExpressApp.EF.Utils
  [Expand]DevExpress.ExpressApp.FileAttachments.Web
  [Expand]DevExpress.ExpressApp.FileAttachments.Win
  [Expand]DevExpress.ExpressApp.Filtering
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Web
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Win
  [Expand]DevExpress.ExpressApp.Kpi
  [Expand]DevExpress.ExpressApp.Layout
  [Expand]DevExpress.ExpressApp.Maps.Mobile
  [Expand]DevExpress.ExpressApp.Maps.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Maps.Web
  [Expand]DevExpress.ExpressApp.Maps.Web.Helpers
  [Expand]DevExpress.ExpressApp.MiddleTier
  [Expand]DevExpress.ExpressApp.Mobile
  [Expand]DevExpress.ExpressApp.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Mobile.MobileModel
  [Expand]DevExpress.ExpressApp.Mobile.SystemModule
  [Expand]DevExpress.ExpressApp.Mobile.Templates
  [Expand]DevExpress.ExpressApp.Model
  [Expand]DevExpress.ExpressApp.Model.Core
  [Expand]DevExpress.ExpressApp.Model.NodeGenerators
  [Expand]DevExpress.ExpressApp.ModelEditor
  [Expand]DevExpress.ExpressApp.Notifications
  [Expand]DevExpress.ExpressApp.Notifications.Web
  [Expand]DevExpress.ExpressApp.Notifications.Win
  [Expand]DevExpress.ExpressApp.Office.Win
  [Expand]DevExpress.ExpressApp.PivotChart
  [Expand]DevExpress.ExpressApp.PivotChart.Web
  [Expand]DevExpress.ExpressApp.PivotChart.Win
  [Expand]DevExpress.ExpressApp.PivotGrid
  [Expand]DevExpress.ExpressApp.PivotGrid.Web
  [Expand]DevExpress.ExpressApp.PivotGrid.Win
  [Expand]DevExpress.ExpressApp.Reports
  [Expand]DevExpress.ExpressApp.Reports.Web
  [Expand]DevExpress.ExpressApp.Reports.Win
  [Expand]DevExpress.ExpressApp.ReportsV2
  [Expand]DevExpress.ExpressApp.ReportsV2.Mobile
  [Expand]DevExpress.ExpressApp.ReportsV2.Web
  [Expand]DevExpress.ExpressApp.ReportsV2.Win
  [Expand]DevExpress.ExpressApp.Scheduler
  [Expand]DevExpress.ExpressApp.Scheduler.Web
  [Expand]DevExpress.ExpressApp.Scheduler.Win
  [Expand]DevExpress.ExpressApp.ScriptRecorder
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Web
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Win
  [Expand]DevExpress.ExpressApp.Security
  [Expand]DevExpress.ExpressApp.Security.Adapters
  [Expand]DevExpress.ExpressApp.Security.ClientServer.Wcf
  [Expand]DevExpress.ExpressApp.Security.EF.Adapters
  [Expand]DevExpress.ExpressApp.Security.Strategy
  [Expand]DevExpress.ExpressApp.Security.Xpo.Adapters
  [Expand]DevExpress.ExpressApp.StateMachine
  [Expand]DevExpress.ExpressApp.SystemModule
  [Expand]DevExpress.ExpressApp.Templates
  [Expand]DevExpress.ExpressApp.Templates.ActionContainers
  [Expand]DevExpress.ExpressApp.TreeListEditors
  [Expand]DevExpress.ExpressApp.TreeListEditors.Web
  [Expand]DevExpress.ExpressApp.TreeListEditors.Win
  [Expand]DevExpress.ExpressApp.Updating
  [Expand]DevExpress.ExpressApp.Utils
  [Expand]DevExpress.ExpressApp.Validation
  [Expand]DevExpress.ExpressApp.Validation.Web
  [Expand]DevExpress.ExpressApp.Validation.Win
  [Expand]DevExpress.ExpressApp.ViewVariantsModule
  [Expand]DevExpress.ExpressApp.Web
  [Expand]DevExpress.ExpressApp.Web.Controls
  [Expand]DevExpress.ExpressApp.Web.Editors
  [Expand]DevExpress.ExpressApp.Web.Editors.ASPx
  [Expand]DevExpress.ExpressApp.Web.SystemModule
  [Expand]DevExpress.ExpressApp.Web.Templates
  [Expand]DevExpress.ExpressApp.Web.Utils
  [Expand]DevExpress.ExpressApp.Win
  [Expand]DevExpress.ExpressApp.Win.Core
  [Expand]DevExpress.ExpressApp.Win.Editors
  [Expand]DevExpress.ExpressApp.Win.Model
  [Expand]DevExpress.ExpressApp.Win.SystemModule
  [Expand]DevExpress.ExpressApp.Win.Templates
  [Expand]DevExpress.ExpressApp.Win.Templates.Navigation
  [Expand]DevExpress.ExpressApp.Win.Utils
  [Expand]DevExpress.ExpressApp.Workflow
  [Expand]DevExpress.ExpressApp.Workflow.Win
  [Collapse]DevExpress.ExpressApp.Xpo
   [Expand]CalculatedPersistentAliasAttribute Class
    XPInstantFeedbackSourceMappingMode Enumeration
   [Collapse]XPObjectSpace Class
     XPObjectSpace Members
    [Expand]XPObjectSpace Constructor
    [Expand]XPObjectSpace Properties
    [Collapse]XPObjectSpace Methods
      ApplyCriteria Method
      ApplyFilter Method
      CanApplyCriteria Method
      CanApplyFilter Method
      CanInstantiate Method
      CombineCriteria Method
      CommitChangesAsync Method
      Contains Method
      CreateInstantFeedbackCollection Method
      CreateNestedObjectSpace Method
      CreateParseCriteriaScope Method
      CreateServerCollection Method
      CreateSortingCollection Method
      Dispose Method
      EnableObjectDeletionOnRemove Method
      Evaluate Method
     [Expand]FindObject Method
      FindObjectSpaceByObject Method
      GetCollectionObjectType Method
      GetCollectionSorting Method
      GetCriteria Method
      GetDisplayableProperties Method
      GetEvaluatorContextDescriptor Method
      GetFilter Method
      GetIntermediateObjectReferences Method
     [Expand]GetKeyValue Method
     [Expand]GetKeyValueAsString Method
      GetListServer Method
      GetObject Method
      GetObjectByKey Method
      GetObjectKey Method
      GetObjectsQuery<T> Method
      GetObjectsToDelete Method
      GetObjectsToSave Method
      GetTopReturnedObjectsCount Method
      IsCollectionLoaded Method
      IsDeletedObject Method
      IsDeletionDeferredType Method
      IsDisposedObject Method
      IsIntermediateObject Method
      IsNewObject Method
      IsObjectDeletionOnRemoveEnabled Method
      IsObjectToDelete Method
      IsObjectToSave Method
      ParseCriteria Method
      RaiseObjectPropertyChanged Method
      ReloadCollection Method
      ReloadObject Method
      RemoveFromModifiedObjects Method
      SetCollectionSorting Method
      SetDisplayableProperties Method
      SetPrefetchPropertyNames Method
      SetTopReturnedObjectsCount Method
      TryGetObjectHandle Method
   [Expand]XPObjectSpaceProvider Class
   [Expand]XpoDataView Class
   [Expand]XpoDataViewRecord Class
   [Expand]XpoTypesInfoHelper Class
  [Expand]DevExpress.ExpressApp.Xpo.Utils
  [Expand]DevExpress.Persistent.Base
  [Expand]DevExpress.Persistent.Base.General
  [Expand]DevExpress.Persistent.Base.ReportsV2
  [Expand]DevExpress.Persistent.Base.Security
  [Expand]DevExpress.Persistent.BaseImpl
  [Expand]DevExpress.Persistent.BaseImpl.EF
  [Expand]DevExpress.Persistent.BaseImpl.EF.PermissionPolicy
  [Expand]DevExpress.Persistent.BaseImpl.PermissionPolicy
  [Expand]DevExpress.Persistent.Validation
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

XPObjectSpace.CreateNestedObjectSpace Method

Creates a nested Object Space.

Namespace:DevExpress.ExpressApp.Xpo
Assembly:DevExpress.ExpressApp.Xpo.v19.1.dll

Expanded Syntax

Return value

Type: IObjectSpace
An IObjectSpace object that is a created nested Object Space.

Expanded Remarks

Use this method to create a nested Object Space for the current Object Space. When committing the changes made within a nested Object Space, they are merged back into the parent Object Space. This allows treating several related operations as a single unified operation.

The code below demonstrates how you can use a nested Object Space to save a new Task object only if its Contact is saved.

By default, Nested Object Spaces are used for modal windows with detail views that represent aggregated objects (see DevExpress.Xpo.AggregatedAttribute). Aggregated objects are considered parts of their owner. When the owner is deleted, its aggregated objects are automatically deleted. Similarly, when the owner is saved, its aggregated objects are also saved. Using nested Object Spaces to represent aggregated object views allows the user to edit these objects in separate windows and choose whether to save or cancel changes (in memory) without immediately saving the owner object. For example:

  • Object Property Editor

    This editor has an ellipsis button that opens a dialog representing the referenced object. This dialog contains a Detail View created in a nested Object Space.

    This editor is suitable for Address type properties. For instance, each Person object has a unique Address. It is convenient to edit the Address object in a separate form, but commit changes together with the owner Person object. Using a nested Object Space in this scenario allows treating Person and Address object modifications as a single operation.

  • Modal Detail View

    A Modal Detail View is usually opened for a new object created using the New action or an object selected in a nested List View that represents an Aggregated Collection. The nested Object Space is used to create this Detail View.

    This is a typical and recommended implementation for a nested collection of objects that are unique for each owner. For instance, an aggregated collection of Phone Numbers owned by a Person.

Nested Object Spaces are implemented based on Nested Units of Work and inherit their behavior and specifics. Refer to the Nested Units of Work documentation for details.

Expanded See Also

Is this topic helpful?​​​​​​​