Back to Devexpress

XPBaseCollection.BindingBehavior Property

xpo-devexpress-dot-xpo-dot-xpbasecollection-c61bf928.md

latest3.5 KB
Original Source

XPBaseCollection.BindingBehavior Property

Defines which operations a bound control can perform on a collection.

This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
[DefaultValue(CollectionBindingBehavior.AllowNew | CollectionBindingBehavior.AllowRemove)]
public CollectionBindingBehavior BindingBehavior { get; set; }
vb
<DefaultValue(CollectionBindingBehavior.AllowNew Or CollectionBindingBehavior.AllowRemove)>
Public Property BindingBehavior As CollectionBindingBehavior

Property Value

TypeDefaultDescription
CollectionBindingBehaviorAllowNewAllowRemove

The CollectionBindingBehavior which specifies which operations a bound control can perform on a collection.

|

Available values:

NameDescription
AllowNone

Specifies that items are not allowed to be added to or removed from a collection by a bound control.

| | AllowNew |

Specifies that new items can be added to a collection by a bound control.

| | AllowRemove |

Specifies that items can be removed from a collection by a bound control.

|

Remarks

The XPBaseCollection class implements the IBindingList interface, so an XPCollection object can be bound to a visual control (for instance, the XtraGrid). The control will interact with the XPCollection via this interface. The BindingBehavior property determines which operations a bound control can perform on the collection (whether adding new and/or removing existing items is allowed for the bound control). Regardless of the BindingBehavior property’s value the collection’s contents can still be modified by calling the collection’s appropriate methods.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BindingBehavior property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-use-tree-list-editors-to-display-list-views/CS/XPO/UseTreeList/UseTreeList.Module/BusinessObjects/CategoryWithIssues.cs#L22

csharp
CollectIssuesRecursive(this, allIssues);
    allIssues.BindingBehavior = CollectionBindingBehavior.AllowNone;
}

See Also

XPBaseCollection Class

XPBaseCollection Members

DevExpress.Xpo Namespace