expressappframework-devexpress-dot-expressapp-dot-systemmodule-43a91166.md
A ViewController descendant that contains the New Action.
Namespace : DevExpress.ExpressApp.SystemModule
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
public class NewObjectViewController :
ViewController,
IComparer<ChoiceActionItem>,
IModelExtender,
ICreateObjectActionProvider
Public Class NewObjectViewController
Inherits ViewController
Implements IComparer(Of ChoiceActionItem),
IModelExtender,
ICreateObjectActionProvider
NewObjectViewController displays the New Action.
ASP.NET Core Blazor Windows Forms
Note
In ASP.NET Core Blazor, the New Action is not available in Detail Views.
Note
In Many-to-Many collections, the New Action is hidden when NewObjectViewController.LinkNewObjectToParentImmediately is set to true.
For more information about the New Action, refer to the NewObjectViewController.NewObjectAction property description.
To customize the default behavior of the New Action, you can inherit from this Controller or subscribe to its events. In addition, you can access the Action to modify its behavior.
| Platform | Descendant |
|---|---|
| ASP.NET Core Blazor | BlazorModificationsController |
| Windows Forms | WinModificationsController |
If you need to inherit from the NewObjectViewController , the following protected virtual methods are available:
|
Method
|
Trigger Action
|
Description
| | --- | --- | --- | |
OnObjectCreating
|
After the New method call, but before the object is created.
|
Raises the NewObjectViewController.ObjectCreating event.
| |
OnCustomAddObjectToCollection
|
After the object has been created, but before it is added to the object collection.
|
Raises the NewObjectViewController.CustomAddObjectToCollection event.
| |
OnObjectCreated
|
After the new object has been created and added to the object collection. If the ObjectCreatedEventArgs.ShowDetailView property is set to true, a Detail View with the new object is invoked after calling this method.
|
Raises the NewObjectViewController.ObjectCreated event.
| |
New
|
The New Action’s SingleChoiceAction.Execute event.
|
ObjectCreatedEventArgs properties.ProcessNewObjectEventArgs.Handled parameter to false.ObjectCreatingArgs.ShowDetailView parameter is set to true.| |
UpdateActionState
|
NewObjectViewController activation, changes in the current ListView’s CollectionSource, and changes in the current View’s AllowNew property. In platform-specific Controllers, this method populates the New Action’s ChoiceActionBase.Items collection.
|
|
To ascertain whether the Controller is active, use the Controller.Active property (see How to: Detect a Lookup List View in Code). If you need to know the reason for its deactivation or activation at runtime, use the DiagnosticInfo Action.
Information about the NewObjectViewController and its New Action is available in the Application Model. To access it, use the Model Editor.
Object MarshalByRefObject Component Controller ViewController NewObjectViewController BlazorNewObjectViewController
See Also
NewObjectViewController Members
How to remove or hide the base class from the New Action's items list