Back to Devexpress

RepositoryItemGridLookUpEditBase.GetIndexByKeyValue(Object) Method

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemgridlookupeditbase-dot-getindexbykeyvalue-x28-system-dot-object-x29.md

latest2.8 KB
Original Source

RepositoryItemGridLookUpEditBase.GetIndexByKeyValue(Object) Method

Returns the index of the row containing the specified RepositoryItemLookUpEditBase.ValueMember field value.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public virtual int GetIndexByKeyValue(
    object keyValue
)
vb
Public Overridable Function GetIndexByKeyValue(
    keyValue As Object
) As Integer

Parameters

NameTypeDescription
keyValueObject

The value of the RepositoryItemLookUpEditBase.ValueMember field for the row to locate.

|

Returns

TypeDescription
Int32

A zero-based index of the row containing the specified RepositoryItemLookUpEditBase.ValueMember field value. -1 if no record with the specified value was found.

|

Remarks

The GetIndexByKeyValue method searches for the row containing the specified key value (value of the RepositoryItemLookUpEditBase.ValueMember field) and returns its index. Note, that this method gets the index of the first row found.

See Also

ValueMember

GetRowByKeyValue(Object)

GetDisplayValueByKeyValue(Object)

RepositoryItemGridLookUpEditBase Class

RepositoryItemGridLookUpEditBase Members

DevExpress.XtraEditors.Repository Namespace