System.ComponentModel.AddingNewEventArgs Class

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

See Also: AddingNewEventArgs Members

Syntax

public class AddingNewEventArgs : EventArgs

Remarks

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.

Requirements

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