Export (0) Print
Expand All

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)

Function GetItemProperties ( _
	listAccessors As PropertyDescriptor() _
) As PropertyDescriptorCollection


Type: System.ComponentModel.PropertyDescriptor()

An array of PropertyDescriptor objects to find in the collection as bindable. This can be Nothing.

Return Value

Type: System.ComponentModel.PropertyDescriptorCollection
The PropertyDescriptorCollection that represents the properties on each item used to bind data.

If the listAccessors parameter is not Nothing, 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 Nothing 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 Function GetItemProperties(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ITypedList.GetItemProperties

    Dim pdc As PropertyDescriptorCollection

    If (Not (listAccessors Is Nothing)) And (listAccessors.Length > 0) Then 
        ' Return child list shape
        pdc = ListBindingHelper.GetListItemProperties(listAccessors(0).PropertyType)
        ' Return properties in sort order
        pdc = properties
    End If 

    Return pdc

End Function

.NET Framework

Supported in: 4.6, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft