ListBindingHelper.GetList Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a list associated with a data source.
Overloads
GetList(Object) |
Returns a list associated with the specified data source. |
GetList(Object, String) |
Returns an object, typically a list, from the evaluation of a specified data source and optional data member. |
GetList(Object)
Returns a list associated with the specified data source.
public:
static System::Object ^ GetList(System::Object ^ list);
public static object GetList (object list);
public static object? GetList (object? list);
static member GetList : obj -> obj
Public Shared Function GetList (list As Object) As Object
Parameters
- list
- Object
The data source to examine for its underlying list.
Returns
An Object representing the underlying list if it exists; otherwise, the original data source specified by list
.
Remarks
If the data source specified by the list
parameter implements the IListSource interface, then the GetList method will return an object of type IList that represents the associated list. Otherwise, this method will just return the specified data source since there is no underlying list.
Applies to
GetList(Object, String)
Returns an object, typically a list, from the evaluation of a specified data source and optional data member.
public:
static System::Object ^ GetList(System::Object ^ dataSource, System::String ^ dataMember);
public static object GetList (object dataSource, string dataMember);
public static object? GetList (object? dataSource, string? dataMember);
static member GetList : obj * string -> obj
Public Shared Function GetList (dataSource As Object, dataMember As String) As Object
Parameters
- dataSource
- Object
The data source from which to find the list.
- dataMember
- String
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
.
Exceptions
The specified data member name did not match any of the properties found for the data source.
Remarks
If the data member is null
or an empty string (""), the GetList method returns dataSource
.
If dataSource
is not a list, GetList returns the value of the dataSource
property that matches the dataMember
value.
If dataSource
is a list, in that it implements either the 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
.
Applies to
.NET