Skip to main content
A newer version of this page is available. .

NewObjectViewController.NewObjectActionItemListMode Property

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

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v18.2.dll

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