Skip to main content
.NET 6.0+

NewObjectViewController.NewObjectActionItemListMode Property

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

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v23.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.

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