System.Windows.Forms.BindingSource.List Property

Gets the list that the connector is bound to.

Syntax

[System.ComponentModel.Browsable(false)]
public IList List { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The System.Windows.Forms.BindingSource class uniformly handles different data sources. Ideally the BindingSource.List property should be set to a general IList. However, sometimes it may be necessary to cast this property to a more specific type. The following table shows the underlying list type, which depends on the type or value of the data source.

BindingSource.DataSource and BindingSource.DataMember are null

An empty ArrayList.

BindingSource.DataSource is null, but BindingSource.DataMember is not null

None; an attempt to get the BindingSource.List will throw an ArgumentException.

An Array instance

An Array.

An System.ComponentModel.IListSource instance

The return value from a call to the System.ComponentModel.IListSource.GetList method of this System.ComponentModel.IListSource instance.

An System.ComponentModel.IBindingList instance

An System.ComponentModel.IBindingList.

An IList instance

An IList.

A non-IList instance of type "T"

A System.ComponentModel.BindingList`1 with one element.

An System.ComponentModel.ICustomTypeDescriptor instance

An ArrayList with one element.

An IEnumerable

An ArrayList with the elements copied over.

The Array type with BindingSource.DataMember of item type "T"

A System.ComponentModel.BindingList`1.

A Type that represents an System.ComponentModel.IListSource or System.ComponentModel.ITypedList

An instance created by a call to the Activator.CreateInstance(Type) method of the Activator class. A NotSupportedException may be thrown.

The IList type with BindingSource.DataMember of item type "T"

-or-

A non-IList type

A System.ComponentModel.BindingList`1.

The System.ComponentModel.ICustomTypeDescriptor type

None; an attempt to get the BindingSource.List will throw an NotSupportedException.

If the type retrieved is the IList interface, the underlying collection may be more complex, such as an ArrayList or System.Data.DataView class.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0