Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions
 [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.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.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
  [Collapse]DevExpress.ExpressApp.SystemModule
   [Expand]AboutInfo Class
   [Expand]ActionControlsSiteController Class
   [Expand]CustomBuildCriteriaEventArgs Class
   [Expand]CustomExportAnalysisEventArgs Class
   [Expand]CustomExportEventArgs Class
   [Expand]CustomGetDefaultFileNameEventArgs Class
   [Expand]CustomGetFiltersEventArgs Class
   [Expand]CustomGetFullTextSearchPropertiesEventArgs Class
   [Expand]CustomizeShowViewParametersEventArgs Class
   [Expand]CustomizeWindowCaptionEventArgs Class
   [Expand]CustomizeWindowStatusMessagesEventArgs Class
   [Expand]CustomShowNavigationItemEventArgs Class
   [Expand]DeleteObjectsViewController Class
   [Expand]DialogController Class
   [Expand]DialogControllerAcceptingEventArgs Class
   [Expand]ExportAnalysisController Class
   [Expand]ExportController Class
   [Expand]FilterController Class
    FullTextSearchTargetPropertiesMode Enumeration
   [Expand]IDataAwareExportable Interface
   [Expand]IDataAwareExportableCsv Interface
   [Expand]IDataAwareExportableXls Interface
   [Expand]IDataAwareExportableXlsx Interface
   [Expand]IExportable Interface
   [Expand]IExportableAnalysisEditor Interface
   [Expand]IModelActionContainer Interface
   [Expand]IModelActionDesignContainerMapping Interface
   [Expand]IModelActionLink Interface
   [Expand]IModelActionToContainerMapping Interface
   [Expand]IModelApplicationCreatableItems Interface
   [Expand]IModelApplicationNavigationItems Interface
   [Expand]IModelClassNavigation Interface
   [Expand]IModelClassNewItemRow Interface
   [Expand]IModelClassShowAutoFilterRow Interface
   [Expand]IModelCreatableItem Interface
   [Expand]IModelCreatableItems Interface
   [Expand]IModelDetailViewDefaultFocusedItem Interface
   [Expand]IModelHiddenActions Interface
   [Expand]IModelListViewFilter Interface
   [Expand]IModelListViewFilterItem Interface
   [Expand]IModelListViewFilters Interface
   [Expand]IModelListViewNewItemRow Interface
   [Expand]IModelListViewPreviewColumn Interface
   [Expand]IModelListViewShowAutoFilterRow Interface
   [Expand]IModelNavigationItem Interface
   [Expand]IModelNavigationItems Interface
   [Expand]IModelOptionsDashboard Interface
   [Expand]IModelOptionsDashboards Interface
   [Expand]IModelPropertyEditorLinkView Interface
   [Expand]IModelRootNavigationItems Interface
   [Expand]IModelViewHiddenActions Interface
   [Expand]LinkUnlinkController Class
   [Expand]ListViewFilterAttribute Class
   [Expand]ListViewProcessCurrentObjectController Class
   [Expand]LogoffController Class
   [Expand]ModelActionContainersGenerator Class
   [Expand]ModelCreatableItemsGenerator Class
   [Expand]ModelListViewFiltersGenerator Class
    ModificationsCheckingMode Enumeration
   [Expand]ModificationsController Class
    ModificationsHandlingMode Enumeration
   [Expand]NavigationItemCreatedEventArgs Class
   [Expand]NavigationItemNodeGenerator Class
    NewObjectActionItemListMode Enumeration
   [Collapse]NewObjectViewController Class
     NewObjectViewController Members
     NewObjectViewController Constructor
    [Collapse]NewObjectViewController Properties
      LinkNewObjectToParentImmediately Property
      NewObjectAction Property
      NewObjectActionItemListMode Property
    [Expand]NewObjectViewController Events
    [Expand]NewObjectViewController Methods
   [Expand]ObjectCreatingEventArgs Class
   [Expand]PrintableChangedEventArgs Class
   [Expand]RecordsNavigationController Class
   [Expand]RefreshController Class
   [Expand]ShowNavigationItemController Class
   [Expand]SystemModule Class
   [Expand]WindowTemplateController Class
  [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.Workflow
  [Expand]DevExpress.ExpressApp.Workflow.Win
  [Expand]DevExpress.ExpressApp.Xpo
  [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]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

NewObjectViewController.NewObjectAction Property

Provides access to the NewObjectViewController's New Action.

Namespace:DevExpress.ExpressApp.SystemModule
Assembly:DevExpress.ExpressApp.v17.2.dll

Expanded Syntax

Property value

Type: SingleChoiceAction
A SingleChoiceAction object representing the New Action.

Expanded Remarks

The New Action is intended to create new objects of one of the predefined types.

Windows Forms application:

ASP.NET application:

You can see in the images above that the New Action in a Windows Forms versus an ASP.NET application contains a different set of items. The Action's ChoiceActionBase.Items collection is populated in the Controller's UpdateActionState method, which is overridden in the WinNewObjectViewController and WebNewObjectViewController descendants.

In a Windows Forms application, the New Action's Items collection is populated by two groups of items. The first one contains the current View's object type (see ObjectView.ObjectTypeInfo) and its descendants. The second one contains the types that are listed in the Application Model's IModelCreatableItems node. This node is generated automatically. The business classes that use the CreatableItemAttribute or DefaultClassOptionsAttribute are added to it. In addition, you can add a class to this node via the Model Editor.

In an ASP.NET application, the New Action's Items collection is populated by one group of items. This group corresponds to the first group of items in the Windows Forms New Action. This group contains the current View's object type and its descendants. This peculiarity is caused by the Web application design. Actually, there are two New Actions in an ASP.NET application. This Action is the first; and the second is the QuickCreateAction Action (see WebNewObjectViewController.QuickCreateAction).

Note

The New Action is not available in Lookup Property Editors and nested List Views that display collection properties participating in a many-to-many relationship.

The QuickCreateAction Action contains items that represent types listed in the Application Model's IModelCreatableItems node, which correspond to the second group in the Windows Forms New Action. So, the New and Quick create Actions in an ASP.NET application are combined into the New Action in a Windows Forms application.

You can modify the Items collection of the Windows Forms New Action, the ASP.NET New Action and the Quick create Actions by using one of the following techniques:

  • To modify the Items collection when the current View's object type and its descendants are added to it, handle the CollectDescendantTypes event of the NewObjectViewController, WinNewObjectViewController or WebNewObjectViewController Controller.
  • To modify the Items collection when the types listed in the CreatableItems node are added to it, handle the CollectCreatableItemTypes event of the NewObjectViewController, WinNewObjectViewController or WebNewObjectViewController Controller.
  • To modify the Items collection after it has been populated, override the UpdateActionState method in the WinNewObjectViewController and/or WebNewObjectViewController class descendant(s).

The New Action is active (visible) under the following conditions:

  • The current View is root (see View.IsRoot) or the current View represents the "Many" part of the One-to-Many relationship.
  • The IModelView.AllowNew property in returns true.
  • The Items collection contains at least one active item.

An item can be missing from the Items collection if the Session-specific constructor is missing in the XPO class. An item can be deactivated if the applied Security System prohibits creating objects of the corresponding type.

To ascertain why the New Action is currently deactivated or disabled, use the DiagnosticInfo Action. If you need to change the Action's "active" or "enabled" state in code, use its ActionBase.Active or ActionBase.Enabled property, respectively.

Information on the New and Quick create Actions is available in the Application Model's ActionDesign node. To access it, use the Model Editor.

Expanded See Also

How would you rate this topic?​​​​​​​