This documentation is archived and is not being maintained.

ITypedList.GetItemProperties Method

Returns the PropertyDescriptorCollection that represents the properties on each item used to bind data.

Namespace: System.ComponentModel
Assembly: System (in system.dll)

PropertyDescriptorCollection GetItemProperties (
	PropertyDescriptor[] listAccessors
)
PropertyDescriptorCollection GetItemProperties (
	PropertyDescriptor[] listAccessors
)
function GetItemProperties (
	listAccessors : PropertyDescriptor[]
) : PropertyDescriptorCollection
Not applicable.

Parameters

listAccessors

An array of PropertyDescriptor objects to find in the collection as bindable. This can be a null reference (Nothing in Visual Basic).

Return Value

The PropertyDescriptorCollection that represents the properties on each item used to bind data.

If the listAccessors parameter is not a null reference (Nothing in Visual Basic), it typically contains a property descriptor that identifies a list of containers to retrieve for the object that implements ITypedList. For example, a DataSet containing two tables, myCustomers and myOrders, with a relationship between them called myCustOrders. If you create a DataView object to view myCustomers, then calling the GetItemProperties method with a null reference (Nothing in Visual Basic) returns the property descriptors for the columns in myCustomers. As a result, one of the returned property descriptors is a property descriptor for myCustOrders, just as calling the GetItemProperties method with a list accessor array containing the property descriptors for myCustOrders will return the property descriptors for myOrders.

The following code example demonstrates how to implement the GetItemProperties method. For a full code listing, see How to: Implement the ITypedList Interface.

public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
{
    PropertyDescriptorCollection pdc = null;

    if (null == listAccessors)
    {
        // Return properties in sort order.
        pdc = properties;
    }
    else
    {
        // Return child list shape.
        pdc = ListBindingHelper.GetListItemProperties(listAccessors[0].PropertyType);
    }

    return pdc;
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0
Show: