Skip to main content
A newer version of this page is available. .

RepositoryItemLookUpEdit.GetDataSourceRowByMultipleKeyValues(Object, Object[], String[]) Method

Searches for an object that represents the row containing the specified field values.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

public virtual object GetDataSourceRowByMultipleKeyValues(
    object keyValue,
    object[] otherValues,
    string[] otherFields
)

Parameters

Name Type Description
keyValue Object

The value of the RepositoryItemLookUpEditBase.ValueMember field for the row to be located.

otherValues Object[]

An array of objects representing values for additional fields against whose values the search is performed.

otherFields String[]

An array of strings specifying the names of the fields against whose values the search will be carried out.

Returns

Type Description
Object

An object representing the data source record containing the specified value. null (Nothing in Visual Basic) if no record is found that matches the given search criteria.

Remarks

The GetDataSourceRowByMultipleKeyValues method allows you to search for a record that contains the specified values. This method returns the first record which has its RepositoryItemLookUpEditBase.ValueMember field set to the keyValue and additional fields specified by the otherFields parameter set to the values passed as otherValues.

If the otherFields or otherValues are set to null or they do not contain elements, the search will be performed against the RepositoryItemLookUpEditBase.ValueMember field.

Note that the otherFields and otherValues parameters must be arrays of the same length. Otherwise an exception is raised.

To search for a record containing a particular key value, you can use the RepositoryItemLookUpEdit.GetDataSourceRowByKeyValue method as well.

The GetDataSourceRowByMultipleKeyValues method’s return value depends upon the type of the underlying data source. If the data source is a System.Data.DataTable or a System.Data.DataView, this method returns a System.Data.DataRowView object. If the data source is a custom list of items, the appropriate list item is returned.

See Also