BindingManagerBase.GetItemProperties Method

Definition

Gets the list of property descriptors for the data source.

Overloads

GetItemProperties()

When overridden in a derived class, gets the collection of property descriptors for the binding.

GetItemProperties(ArrayList, ArrayList)

Gets the collection of property descriptors for the binding using the specified ArrayList.

GetItemProperties(Type, Int32, ArrayList, ArrayList)

Gets the list of properties of the items managed by this BindingManagerBase.

GetItemProperties()

Source:
BindingManagerBase.cs
Source:
BindingManagerBase.cs
Source:
BindingManagerBase.cs

When overridden in a derived class, gets the collection of property descriptors for the binding.

C#
public abstract System.ComponentModel.PropertyDescriptorCollection GetItemProperties();
C#
public virtual System.ComponentModel.PropertyDescriptorCollection GetItemProperties();

Returns

A PropertyDescriptorCollection that represents the property descriptors for the binding.

Examples

The following code example uses the GetItemProperties method to return a PropertyDescriptorCollection. The example prints the Name and value of the current DataColumn using the GetValue method of the PropertyDescriptor.

C#
private void ShowGetItemProperties()
{
   // Create a new DataTable and add two columns.
   DataTable dt = new DataTable();
   dt.Columns.Add("Name", Type.GetType("System.String"));
   dt.Columns.Add("ID", Type.GetType("System.String"));
   // Add a row to the table.
   DataRow dr = dt.NewRow();
   dr["Name"] = "Ann";
   dr["ID"] = "AAA";
   dt.Rows.Add(dr);

   PropertyDescriptorCollection myPropertyDescriptors = 
   this.BindingContext[dt].GetItemProperties();
   PropertyDescriptor myPropertyDescriptor = 
   myPropertyDescriptors["Name"];
   Console.WriteLine(myPropertyDescriptor.Name);
   Console.WriteLine(myPropertyDescriptor.GetValue
   (dt.DefaultView[0]));
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GetItemProperties(ArrayList, ArrayList)

Source:
BindingManagerBase.cs
Source:
BindingManagerBase.cs
Source:
BindingManagerBase.cs

Gets the collection of property descriptors for the binding using the specified ArrayList.

C#
protected internal virtual System.ComponentModel.PropertyDescriptorCollection GetItemProperties(System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);
C#
protected internal virtual System.ComponentModel.PropertyDescriptorCollection? GetItemProperties(System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);

Parameters

dataSources
ArrayList

An ArrayList containing the data sources.

listAccessors
ArrayList

An ArrayList containing the table's bound properties.

Returns

A PropertyDescriptorCollection that represents the property descriptors for the binding.

Remarks

This method is used by developers creating data-bound controls.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GetItemProperties(Type, Int32, ArrayList, ArrayList)

Source:
BindingManagerBase.cs
Source:
BindingManagerBase.cs
Source:
BindingManagerBase.cs

Gets the list of properties of the items managed by this BindingManagerBase.

C#
protected virtual System.ComponentModel.PropertyDescriptorCollection GetItemProperties(Type listType, int offset, System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);
C#
protected virtual System.ComponentModel.PropertyDescriptorCollection? GetItemProperties(Type listType, int offset, System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors);

Parameters

listType
Type

The Type of the bound list.

offset
Int32

A counter used to recursively call the method.

dataSources
ArrayList

An ArrayList containing the data sources.

listAccessors
ArrayList

An ArrayList containing the table's bound properties.

Returns

A PropertyDescriptorCollection that represents the property descriptors for the binding.

Examples

The following code example uses the GetItemProperties method to return a PropertyDescriptorCollection for a BindingManagerBase. The example then prints out the Name and PropertyType of each PropertyDescriptor in the collection.

C#
private void PrintPropertyDescriptions(BindingManagerBase b)
{
   Console.WriteLine("Printing Property Descriptions");
   PropertyDescriptorCollection ps = b.GetItemProperties();
   for(int i = 0; i < ps.Count; i++)
   {
      Console.WriteLine("\t" + ps[i].Name + "\t" + ps[i].PropertyType);
   }
}

Remarks

This overload is used by developers to create data-bound controls.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9