System.ComponentModel.BindingList<T>.AllowNew Property

Gets or sets a value indicating whether you can add items to the list using the BindingList`1.AddNew method.

Syntax

public bool AllowNew { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

The BindingList`1.AllowNew property is typically used by other components to determine if the creation of new items is allowed. BindingList`1.AllowNew defaults to true if the type contained in the list has a default constructor or the BindingList`1.AddingNew event is handled. If the BindingList`1.AddingNew event is not handled or the list type does not have a default constructor, then BindingList`1.AllowNew defaults to false.

If BindingList`1.AllowNew is explicitly set, the set value will always be used by bound objects to determine if new items can be added to the list. Whether BindingList`1.AllowNew is true or false, new items can be added by explicitly calling BindingList`1.AddNew if the list type has a default constructor or the BindingList`1.AddingNew event is handled. In addition, setting BindingList`1.AllowNew causes a BindingList`1.ListChanged event of type ListChangedType.Reset to occur.

Requirements

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