Skip to main content

RepositoryItemGridLookUpEdit.GetDisplayTextByKeyValue(Object) Method

Returns the text representation of the DisplayMember field value of the row that contains the specified ValueMember field value.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraGrid.v24.2.dll

Declaration

public virtual string GetDisplayTextByKeyValue(
    object keyValue
)

Parameters

Name Type Description
keyValue Object

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

Returns

Type Description
String

The text representation of the DisplayMember field value for the row located.

Remarks

The GetDisplayTextByKeyValue method searches for the record which contains the specified key value (value of the RepositoryItemLookUpEditBase.ValueMember field) and returns the display value it contains. The display value is retrieved from the RepositoryItemLookUpEditBase.DisplayMember field of the record located. This method returns the display value of the first record found.

The row currently selected in a lookup editor is determined by the BaseEdit.EditValue property value and this matches the value of the rows’s ValueMember field. The value of the DisplayMember field of the selected row is displayed in the edit box.

See Also