System.Windows.Forms.BindingSource.Find Method

Searches for the index of the item that has the given property descriptor.

Syntax

public virtual int Find (System.ComponentModel.PropertyDescriptor prop, object key)

Parameters

prop
The System.ComponentModel.PropertyDescriptor to search for.
key
The value of prop to match.

Returns

The zero-based index of the item that has the given value for System.ComponentModel.PropertyDescriptor.

Remarks

This method is typically used in complex data-binding cases to locate the first row where the value of the field specified by the prop parameter equals the value of the key parameter

This method simply refers the request to the underlying list's System.ComponentModel.IBindingList.Find(System.ComponentModel.PropertyDescriptor, object) method. For example, if the underlying data source is a System.Data.DataSet, System.Data.DataTable, or System.Data.DataView, this method calls the System.Data.DataView.System#ComponentModel#IBindingList#Find(System.ComponentModel.PropertyDescriptor, object) method. The behavior of System.ComponentModel.IBindingList.Find(System.ComponentModel.PropertyDescriptor, object), such as the value returned if no matching item is found, depends on the implementation of the method in the underlying list.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0