System.ComponentModel.AddingNewEventArgs Class

Provides data for the System.Windows.Forms.BindingSource.AddingNew event.

See Also: AddingNewEventArgs Members


public class AddingNewEventArgs : EventArgs


The System.ComponentModel.AddingNewEventArgs class provides data for the System.Windows.Forms.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 System.ComponentModel.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 System.ComponentModel.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 System.Windows.Forms.BindingSource and System.ComponentModel.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