Skip to main content
.NET Framework 4.5.2+

NewObjectViewController.CustomAddObjectToCollection Event

Occurs before adding a newly created object of the type selected in the NewObjectViewController.NewObjectAction‘s control to an associated collection.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler<ProcessNewObjectEventArgs> CustomAddObjectToCollection

Event Data

The CustomAddObjectToCollection event's data class is DevExpress.ExpressApp.SystemModule.ProcessNewObjectEventArgs.

Remarks

By default, after an object of the specified type has been created, it is added to the View’s collection source, if the View is a List View. If the current View is a Detail View opened from a List View, the newly created object is added to the List View’s collection source. Handle this event if you need to customize the way the object is added. To cancel the default process of adding the object to the described collections, set the handler’s ProcessNewObjectEventArgs.Handled parameter to true.

After this event has been raised, the Detail View is invoked to allow an end-user to customize the created object. However, the Detail View will not be shown if the View.QueryCanChangeCurrentObject event handler’s ObjectCreatingEventArgs.ShowDetailView parameter is set to false. By default, it is set to false.

See Also