ControlBindingsCollection

Wisej.Web.ControlBindingsCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.0.0.0)

Represents the collection of data bindings for a IBindableComponent.

public class ControlBindingsCollection : ControlBindingsCollection

Constructors

ControlBindingsCollection(component)

Initializes a new instance of the ControlBindingsCollection class with the specified bindable control.

Name
Type
Description

component

The IBindableComponent the binding collection belongs to.

Properties

BindableComponent

IBindableComponent: Returns the IBindableComponent associated the binding collection.

Control

Control: Returns the Control that the collection belongs to.

DefaultDataSourceUpdateMode

DataSourceUpdateMode: Returns or sets the default DataSourceUpdateMode for a Binding in the collection.

Item(name)

Binding: Returns the Binding specified by the control's property name.

Item(index)

Binding: Returns the Binding at the specified index.

Throws:

Methods

Add(propertyName, dataSource, dataMember, formattingEnabled, formatString)

Adds the specified Binding to the collection.

Parameter
Type
Description

propertyName

dataSource

dataMember

formattingEnabled

formatString

Returns: Binding.

Throws:

Add(propertyName, dataSource, dataMember, formattingEnabled, nullValue, formatString)

Creates a Binding using the specified control property name, data source, and data member, and adds it to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object that represents the data source.

dataMember

The property or list to bind to.

formattingEnabled

nullValue

formatString

Returns: Binding. The newly created Binding.

Throws:

  • Exception The propertyName is already data-bound.

  • Exception The dataMember doesn't specify a valid member of the dataSource .

Add(propertyName, dataSource, dataMember, formattingEnabled, updateMode)

Creates a binding with the specified control property name, data source, data member, and information about whether formatting is enabled, and adds the binding to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object representing the data source.

dataMember

The property or list to bind to.

formattingEnabled

true to format the displayed data; otherwise, false

Returns: Binding. The newly created Binding.

Throws:

  • ArgumentException The property given by propertyName does not exist on the control.-or-The property given is a read-only property.

  • Exception If formatting is disabled and the propertyName is neither a valid property of a control nor an empty string ("").

Add(propertyName, dataSource, dataMember, formattingEnabled, updateMode, nullValue)

Creates a binding with the specified control property name, data source, data member, and information about whether formatting is enabled, and adds the binding to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object representing the data source.

dataMember

The property or list to bind to.

formattingEnabled

true to format the displayed data; otherwise, false

nullValue

Returns: Binding. The newly created Binding.

Throws:

  • ArgumentException The property given by propertyName does not exist on the control.-or-The property given is a read-only property.

  • Exception If formatting is disabled and the propertyName is neither a valid property of a control nor an empty string ("").

Add(propertyName, dataSource, dataMember, formattingEnabled, updateMode, nullValue, formatString)

Creates a binding with the specified control property name, data source, data member, and information about whether formatting is enabled, and adds the binding to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object representing the data source.

dataMember

The property or list to bind to.

formattingEnabled

true to format the displayed data; otherwise, false

nullValue

The Object to be applied to the bound control property if the data source value is DBNull.

formatString

One or more format specifier characters that indicate how a value is to be displayed.

Returns: Binding. The newly created Binding.

Throws:

  • ArgumentException The property given by propertyName does not exist on the control.-or-The property given is a read-only property.

  • Exception If formatting is disabled and the propertyName is neither a valid property of a control nor an empty string ("").

Add(propertyName, dataSource, dataMember, formattingEnabled, updateMode, nullValue, formatString, formatInfo)

Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting, propagating values to the data source based on the specified update setting, and adding the binding to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object representing the data source.

dataMember

The property or list to bind to.

formattingEnabled

true to format the displayed data; otherwise, false.

updateMode

One of the DataSourceUpdateMode values.

nullValue

formatString

formatInfo

Returns: Binding. The newly created Binding.

Throws:

  • ArgumentException The property given by propertyName does not exist on the control or is read-only.-or-The specified data member does not exist on the data source.-or-The data source, data member, or control property specified are associated with another binding in the collection.

Add(binding)

Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, and adding the binding to the collection.

Parameter
Type
Description

binding

Throws:

  • ArgumentException The property given by propertyName does not exist on the control or is read-only.-or-The specified data member does not exist on the data source.-or-The data source, data member, or control property specified are associated with another binding in the collection.

Add(propertyName, dataSource, dataMember)

Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting with the specified format string, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, and adding the binding to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object representing the data source.

dataMember

The property or list to bind to.

Returns: Binding. The newly created Binding

Throws:

  • ArgumentException The property given by propertyName does not exist on the control or is read-only.-or-The specified data member does not exist on the data source.-or-The data source, data member, or control property specified are associated with another binding in the collection.

Add(propertyName, dataSource, dataMember, formattingEnabled)

Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting with the specified format string, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, setting the specified format provider, and adding the binding to the collection.

Parameter
Type
Description

propertyName

The name of the control property to bind.

dataSource

An Object representing the data source.

dataMember

The property or list to bind to.

formattingEnabled

true to format the displayed data; otherwise, false.

Returns: Binding. The newly created Binding.

Throws:

  • ArgumentException The property given by propertyName does not exist on the control or is read-only.-or-The specified data member does not exist on the data source.-or-The data source, data member, or control property specified are associated with another binding in the collection.

AddCore(binding)

Adds a Binding to the collection.

Parameter
Type
Description

binding

The Binding to add to the collection.

Throws:

Clear()

Removes all bindings in the collection.

OnCollectionChanged(e)

Fires the CollectionChanged event.

Parameter
Type
Description

OnCollectionChanging(e)

Fires the CollectionChanging event.

Parameter
Type
Description

Remove(binding)

Removes the specified Binding from the collection.

Parameter
Type
Description

binding

The Binding to remove.

Throws:

RemoveAt(index)

Removes the Binding at the specified index.

Parameter
Type
Description

index

The zero-based index of the item to remove.

Throws:

Events

CollectionChanged

CollectionChangeEventHandler Fired when the collection has changed.

CollectionChanging

CollectionChangeEventHandler Fired when the collection is about to change.

Last updated

Was this helpful?