Skip to main content
.NET Standard 2.0+

NewObjectViewController Class

Represents a ViewController descendant that contains the New Action.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v22.1.dll


public class NewObjectViewController :


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.

  • Creates a new object using ObjectCreatedEventArgs‘ properties.
  • Adds the new object to the collection source of the Controller’s current List View. If the current View represents a Detail View, the object is added to the List View from which the Detail View has been added. If you need to add the new object in a custom way, handle the NewObjectViewController.CustomAddObjectToCollection event and set the handler’s ProcessNewObjectEventArgs.Handled parameter to false.
  • Shows a Detail View with the new object, if the NewObjectViewController.ObjectCreating event handler’s ObjectCreatingArgs.ShowDetailView parameter is set to true.


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.

Information on the NewObjectViewController and its New Action is available in the Application Model. To access it, use the Model Editor.

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.

See Also