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:
When is it called?
Invoked as a result of calling the New method before creating a new object of the chosen type.
Raises the NewObjectViewController.ObjectCreating event.
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.
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.
When the New Action’s SingleChoiceAction.Execute event is raised.
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.
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.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the NewObjectViewController class.
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.