NewObjectViewController.CollectCreatableItemTypes Event
Occurs when the NewObjectViewController.NewObjectAction‘s Items List is generated or updated.
Namespace: DevExpress.ExpressApp.SystemModule
Assembly: DevExpress.ExpressApp.v24.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Event Data
The CollectCreatableItemTypes 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. To modify the list of the types added first, handle the NewObjectViewController.CollectDescendantTypes event. To modify the list of the types added second, handle the CollectCreatableItemTypes event. To access this list, use the handler’s CollectTypesEventArgs.Types parameter.
In ASP.NET Web Forms applications, there are two Actions: New and NewRootObject. The Items list of the former corresponds to the first items group of the New Action in Windows Forms applications. The Items list of the latter Action corresponds to the second items group of the Windows Forms New Action. So, handle the NewObjectViewController.CollectDescendantTypes event to customize the Items collection of the New Action in an ASP.NET Web Forms application. To customize the Items list of the ASP.NET Web Forms NewRootObject Action, handle the CollectCreatableItemTypes event.
Note
When you need to customize the Items list of the New Action in the Windows Forms or the QuickCreateAction Action in the ASP.NET Web Forms application version only, handle this event for the WinNewObjectViewController or WebNewObjectViewController individually.
If you need to inherit from the NewObjectViewController and override the caller of the CollectCreatableItemTypes event, inherit from the WinNewObjectViewController and/or WebNewObjectViewControllers 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 CollectCreatableItemTypes event, refer to the How to: Customize the New Action’s Items List topic.