System.ComponentModel.AddingNewEventArgs Class

Provides data for the BindingSource.AddingNew event.

See Also: AddingNewEventArgs


public class AddingNewEventArgs : EventArgs


The AddingNewEventArgs class provides data for the BindingSource.AddingNew event, which signals that an item is about to be added to a collection. The event gives the programmer, within the event handler AddingNewEventHandler, the option of supplying the new object by setting the AddingNewEventArgs.NewObject property to this new item. If this property is not set, the collection will typically use the default constructor of the appropriate type to construct a new item. In either case, the new item will be added to the collection.

If the collection also implements the ICancelAddNew interface, the item will be provisionally added, waiting a subsequent commit or rollback.

This event is commonly used in data-binding scenarios, within classes such as BindingSource and BindingList`1.

For more information about handling events, see Consuming Events.


Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions:,
Since: .NET 2.0

The members of System.ComponentModel.AddingNewEventArgs are listed below.

See Also: EventArgs

Public Constructors

Initializes a new instance of the AddingNewEventArgs class using no parameters.

Initializes a new instance of the AddingNewEventArgs class using the specified object as the new item.

Public Properties


Gets or sets the object to be added to the binding list.