Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 GetItemProperties Method
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
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)
Visual Basic (Declaration)
Function GetItemProperties ( _
    listAccessors As PropertyDescriptor() _
) As PropertyDescriptorCollection
Visual Basic (Usage)
Dim instance As ITypedList
Dim listAccessors As PropertyDescriptor()
Dim returnValue As PropertyDescriptorCollection

returnValue = instance.GetItemProperties(listAccessors)
C#
PropertyDescriptorCollection GetItemProperties(
    PropertyDescriptor[] listAccessors
)
Visual C++
PropertyDescriptorCollection^ GetItemProperties(
    array<PropertyDescriptor^>^ listAccessors
)
JScript
function GetItemProperties(
    listAccessors : PropertyDescriptor[]
) : PropertyDescriptorCollection

Parameters

listAccessors
Type: array<System.ComponentModel..::.PropertyDescriptor>[]()[]
An array of PropertyDescriptor objects to find in the collection as bindable. This can be nullNothingnullptra null reference (Nothing in Visual Basic).

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 nullNothingnullptra 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 nullNothingnullptra 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.

Visual Basic
Public Function GetItemProperties(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ITypedList.GetItemProperties

    Dim pdc As PropertyDescriptorCollection = Nothing

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

End Function
C#
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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

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

.NET Framework

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

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
GetItemProperties() - return value      ThomasHepp   |   Edit   |   Show History

Hallo,

I have a problem with the GetItemProperties()-Method. What have I to return if the array of PropertyDescriptors has more then one listAccessor? I tried to return only the first one and I tried to return PropertyDescriptors foreach item in the array. I'm alway getting an exeption by GetValue().

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker