Back to Devexpress

RepositoryItemLookUpEdit.GetDisplayValueByMultipleKeyValues(Object, Object[], String[]) Method

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemlookupedit-dot-getdisplayvaluebymultiplekeyvalues-x28-system-dot-object-system-dot-object-system-dot-string-x29.md

latest4.7 KB
Original Source

RepositoryItemLookUpEdit.GetDisplayValueByMultipleKeyValues(Object, Object[], String[]) Method

Gets a value of the RepositoryItemLookUpEditBase.DisplayMember field by multiple key values.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual object GetDisplayValueByMultipleKeyValues(
    object keyValue,
    object[] otherValues,
    string[] otherFields
)
vb
Public Overridable Function GetDisplayValueByMultipleKeyValues(
    keyValue As Object,
    otherValues As Object(),
    otherFields As String()
) As Object

Parameters

NameTypeDescription
keyValueObject

The value of the RepositoryItemLookUpEditBase.ValueMember field for the row to be located.

| | otherValues | Object[] |

An array of objects representing values for additional fields against whose values the search is performed.

| | otherFields | String[] |

An array of strings specifying names of additional fields against whose values the search is carried out.

|

Returns

TypeDescription
Object

The value of the RepositoryItemLookUpEditBase.DisplayMember field for the row located. null if no record with the specified value was found.

|

Remarks

Lookup editors store and display field values specified by the RepositoryItemLookUpEditBase.ValueMember and RepositoryItemLookUpEditBase.DisplayMember properties. You can obtain display values by corresponding key values via the RepositoryItemLookUpEdit.GetDisplayValueByKeyValue method call. However, the key field specified by the RepositoryItemLookUpEditBase.ValueMember property doesn’t necessarily contain unique values. In such a case, the RepositoryItemLookUpEdit.GetDisplayValueByKeyValue method returns a display value corresponding to the first occurrence of the specified key value.

The GetDisplayValueByMultipleKeyValues method allows you to assign additional search criteria if the key field is not unique. You must specify the array of fields and their values in addition to the key value. These arrays are set via the otherFields and otherValues parameters. If these parameters are not assigned, the GetDisplayValueByMultipleKeyValues method works like the RepositoryItemLookUpEdit.GetDisplayValueByKeyValue method.

Note that the otherFields and otherValues parameters must be arrays of the same length. Otherwise an exception is raised.

See Also

DisplayMember

ValueMember

GetDisplayValueByKeyValue(Object)

RepositoryItemLookUpEdit Class

RepositoryItemLookUpEdit Members

DevExpress.XtraEditors.Repository Namespace