Skip to main content

NewObjectViewController.CollectDescendantTypes Event

Occurs when the NewObjectViewController.NewObjectAction‘s Items List is generated or updated.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v25.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler<CollectTypesEventArgs> CollectDescendantTypes

Event Data

The CollectDescendantTypes event's data class is DevExpress.ExpressApp.SystemModule.CollectTypesEventArgs.

Remarks

In Windows Forms applications, the New Action’s Items list is generated in two steps. First, the current View’s object type and its descendants are added; second, the types listed in the Application Model‘s IModelCreatableItems node are added.

Handle the CollectDescendantTypes event to change types displayed in the New action. To access the list of these types, use the handler’s CollectTypesEventArgs.Types parameter. To modify the list of additional creatable types in Windows Forms, handle the NewObjectViewController.CollectCreatableItemTypes event.

If you need to inherit from the NewObjectViewController and override the caller of the CollectDescendantTypes event, inherit from the WinNewObjectViewController and/or BlazorNewObjectViewController class and override the UpdateActionState method. In this method, you can get the NewObjectViewController.NewObjectAction‘s Items collection via the ChoiceActionBase.Items property, and customize it as required.

To see examples of how to handle the CollectDescendantTypes event, refer to the How to: Customize the New Action’s Items List topic.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CollectDescendantTypes event.

Note

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