windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemlookupedit-dot-getdatasourcerowbydisplayvalue-x28-system-dot-object-x29.md
Searches the DisplayMember data field for the specified value and returns the first matching data source record.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public virtual object GetDataSourceRowByDisplayValue(
object displayValue
)
Public Overridable Function GetDataSourceRowByDisplayValue(
displayValue As Object
) As Object
| Name | Type | Description |
|---|---|---|
| displayValue | Object |
The value to search for in the data field specified by the DisplayMember property.
|
| Type | Description |
|---|---|
| Object |
The data source record that contains the specified value. null ( Nothing in Visual Basic) if no record with the specified value was found.
|
The lookup editor displays values from the data source field specified by the DisplayMember property. The GetDataSourceRowByDisplayValue method searches this data field for the specified value and returns the first matching record.
Note
The search is case-sensitive.
The GetDataSourceRowByDisplayValue method’s return type varies based on the data source:
System.Data.DataTable or System.Data.DataView, the method returns a System.Data.DataRowView object.The following code snippet searches the lookup editor’s data source for a record where the ProductName field contains ‘Chai’:
object result = lookUpEdit1.Properties.GetDataSourceRowByDisplayValue("Chai");
See Also
GetDataSourceRowByKeyValue(Object)
GetDataSourceRowByMultipleKeyValues(Object, Object[], String[])
GetDisplayValueByKeyValue(Object)
GetKeyValueByDisplayValue(Object)
RepositoryItemLookUpEdit Class