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

RepositoryItemLookUpEdit.GetDataSourceRowIndex(String, Object) Method

Returns the visual index of the row in the dropdown that contains the specified value in the specified field.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

public virtual int GetDataSourceRowIndex(
    string fieldName,
    object value
)

Parameters

Name Type Description
fieldName String

A string that is the field whose values will be compared with the specified value to locate the required row.

value Object

A value contained in the required row in the specified field.

Returns

Type Description
Int32

An integer value that is the row’s zero-based visual index in the dropdown. -1 if such a row is not found.

Remarks

This overload can be used to find the row’s vsual index by a specific field’s value, even if there isn’t any column in the RepositoryItemLookUpEdit.Columns collection bound to this field.

The index returned can be used to obtain the row’s specific value via the RepositoryItemLookUpEdit.GetDataSourceValue method.

To get the index of a specific row in the underlying data source, use the RepositoryItemLookUpEdit.GetListSourceIndex method.

See Also