Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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