Skip to main content

RepositoryItemSearchLookUpEdit.GetDisplayValueByKeyValueEx(Object, OperationCompleted[]) Method

Returns a value of the RepositoryItemLookUpEditBase.DisplayMember field of the row containing the specified RepositoryItemLookUpEditBase.ValueMember field value. Allows you to get values in Instant Feedback Mode.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraGrid.v24.1.dll

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

Declaration

public object GetDisplayValueByKeyValueEx(
    object keyValue,
    params OperationCompleted[] completed
)

Parameters

Name Type Description
keyValue Object

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

completed DevExpress.Data.OperationCompleted[]

A DevExpress.Data.OperationCompleted method that will be called when the requested display value is ready to be returned.

Returns

Type Description
Object

The value of the RepositoryItemLookUpEditBase.DisplayMember field for the row located.null if no record with the specified value was found (System.DBNull.Value and the data source is a DataView object).

Remarks

For general information on this method, see RepositoryItemGridLookUpEditBase.GetDisplayValueByKeyValue.

The following notes apply to SearchLookUpEdit, when Instant Feedback Mode (async server mode) is enabled.

In this mode, data is loaded by the control dynamically, in portions. When calling the GetDisplayValueByKeyValueEx method, the requested display value may not be currently loaded. If the value is not loaded, the GetDisplayValueByKeyValueEx method will immediately return a special invalid “Non-loaded Value”. You can check whether the returned value is an invalid “Non-loaded Value” via the static BaseEdit.IsNotLoadedValue method. If the value returned is valid, the BaseEdit.IsNotLoadedValue method will return false.

To always get a valid value, define a method of the DevExpress.Data.OperationCompleted type, and call the GetDisplayValueByKeyValueEx method, passing your OperationCompleted method as the second parameter. Your OperationCompleted method will be called when the corresponding value has been loaded, and is ready for use.

See Also