Skip to main content

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.v22.2.dll

NuGet Package: DevExpress.Win.Navigation


public virtual int GetDataSourceRowIndex(
    string fieldName,
    object value


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.


Type Description

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


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