Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

NewObjectViewController.NewObjectActionItemListMode Property

Specifies the mode for populating the NewObjectViewController.NewObjectAction items list.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

[DefaultValue(NewObjectActionItemListMode.Default)]
public NewObjectActionItemListMode NewObjectActionItemListMode { get; set; }

#Property Value

Type Default Description
NewObjectActionItemListMode Default

An NewObjectActionItemListMode enumeration value specifying the mode for populating the New Action’s items list.

Available values:

Name Description
Default

The current type and all of its descendant types are added.

ExcludeBaseType

All descendants of the current type are added. The current type itself is excluded.

LastDescendantsOnly

Only the last types in the inheritance hierarchy of the current type are added.

#Remarks

Use the following code to change the NewObjectActionItemListMode value in a specific View.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.Persistent.BaseImpl;
// ...
public class CustomizeNewActionItemsListController : ObjectViewController<ObjectView, Task> {
    protected override void OnActivated() {
        base.OnActivated();
        NewObjectViewController controller = Frame.GetController<NewObjectViewController>();
        if (controller != null) {
            controller.NewObjectActionItemListMode = NewObjectActionItemListMode.LastDescendantsOnly;
        } 
    }
}

To specify the default value applied in all Views, use the static NewObjectViewController.DefaultNewObjectActionItemListMode field.

The NewObjectActionItemListMode value is ignored in a case when there are no descendants of the current business object type. In the ExcludeBaseType and LastDescendantsOnly modes, the New Action may become inactive if it is impossible to instantiate any of the descendants (e.g., due to the Security System restrictions).

If the modes listed in the NewObjectActionItemListMode enumeration do not fit your requirements, handle the NewObjectViewController.CollectDescendantTypes and NewObjectViewController.CollectCreatableItemTypes events instead of using the NewObjectActionItemListMode property. An example is provided in the How to: Customize the New Action’s Items List topic.

See Also