NewObjectViewController Class
Represents a ViewController descendant that contains the New Action.
Namespace: DevExpress.ExpressApp.SystemModule
Assembly: DevExpress.ExpressApp.v21.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Remarks
The NewObjectViewController is intended for presenting the New Action.
In a Windows Forms application:
In an ASP.NET Web Forms application:
For details on the New Action, refer to the description of the NewObjectViewController.NewObjectAction property that provides access to this Action.
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.
If you need to inherit from the NewObjectViewController, the following protected virtual methods are available:
Method | When is it called? | Description |
---|---|---|
OnObjectCreating | Invoked as a result of calling the New method before creating a new object of the chosen type. | Raises the NewObjectViewController.ObjectCreating event. |
OnCustomAddObjectToCollection | Invoked as a result of calling the New method after the new object has been created, but not added to the current object collection. | Raises the NewObjectViewController.CustomAddObjectToCollection event. |
OnObjectCreated | Invoked as a result of calling the New method after the new object has been created and added to the current 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 | When the New Action’s SingleChoiceAction.Execute event is raised. |
|
UpdateActionState | Called when the NewObjectViewController is activated. In addition, it is called when the current ListView’s CollectionSource is changed, and when the current View’s View.AllowNew property is changed. In this Controller’s platform-specific descendants, this method is overridden to populate the New Action’s ChoiceActionBase.Items collection. |
|
Public members are described individually in the documentation.
Note
Inherit from the DevExpress.ExpressApp.Win.SystemModule.WinNewObjectViewController or DevExpress.ExpressApp.Web.SystemModule.WebNewObjectViewController class, if you need to implement a UI-specific behavior.
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 on the NewObjectViewController and its New Action is available in the Application Model. To access it, use the Model Editor.