RepositoryItemLookUpEdit.GetKeyValueByDisplayText(String) Method
Returns the value of the RepositoryItemLookUpEditBase.ValueMember field for the row whose RepositoryItemLookUpEditBase.DisplayMember value matches the specified text.
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
display |
String | A text representation of the Repository |
#Returns
Type | Description |
---|---|
Object | The value of the Repository |
#Remarks
The GetKeyValueByDisplayText method searches for the record whose RepositoryItemLookUpEditBase.DisplayMember field’s text representation matches the specified string. The value of the RepositoryItemLookUpEditBase.ValueMember field is retrieved by this method. This method returns the value of the first record found.
To get the display value by the record’s key value, see the RepositoryItemLookUpEdit.GetDisplayValueByKeyValue function.
The GetKeyValueByDisplayText and RepositoryItemLookUpEdit.GetDisplayValueByKeyValue methods perform a search among rows that are present in the LookUp editor’s dropdown. If a target row has been hidden due to filtering (see RepositoryItemLookUpEdit.SearchMode), these methods will return null.