System.Windows.Forms.ListBindingHelper.GetList Method

Returns an object, typically a list, from the evaluation of a specified data source and optional data member.

Syntax

public static object GetList (object dataSource, string dataMember)

Parameters

dataSource
The data source from which to find the list.
dataMember
The name of the data source property that contains the list. This can be null.

Returns

An object representing the underlying list if it was found; otherwise, dataSource.

Remarks

If the data member is null or an empty string (""), the ListBindingHelper.GetList(object, string) method returns dataSource.

If dataSource is not a list, ListBindingHelper.GetList(object, string) returns the value of the dataSource property that matches the dataMember value.

If dataSource is a list, in that it implements either the System.Windows.Forms.ICurrencyManagerProvider or IEnumerable interfaces, then the underlying list is obtained by choosing an item from the list and querying that item for the value of the property named by dataMember.

Requirements

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