BindingList<T>::AllowNew Property
Gets or sets a value indicating whether you can add items to the list using the AddNew method.
Assembly: System (in System.dll)
The AllowNew property is typically used by other components to determine if the creation of new items is allowed. AllowNew defaults to true if the type contained in the list has a default constructor or the AddingNew event is handled. If the AddingNew event is not handled or the list type does not have a default constructor, then AllowNew defaults to false.
If 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 AllowNew is true or false, new items can be added by explicitly calling AddNew if the list type has a default constructor or the AddingNew event is handled. In addition, setting AllowNew causes a ListChanged event of type Reset to occur.
The following code example demonstrates how to set the AllowNew property. For the complete example, see the BindingList<T> class overview topic.
Available since 2.0