Description:
How to obtain the selected row from the LookUp editor? I want to obtain the selected row's value and display it in a label.
Answer:
The current key value is stored in the editor's EditValue property. If you need to obtain a row object by a given key, you should use the GetDataSourceRowByKeyValue method of the RepositoryItemLookUpEdit. Here is the code:
C#object row = lookUpEdit1.Properties.GetDataSourceRowByKeyValue(lookUpEdit1.EditValue);
label1.Text = (row as DataRowView)["Description"].ToString();
See Also:
How to obtain a value for a specific column within the LookupEdit which corresponds to the currently selected row
How to implement an incremental search feature for an edit form via the LookUpEdit
wow that work fine thank you…
is it possible to do same in gridview ??
Hi,
In order not to mix multiple questions within one thread, I have extracted your inquiry to a separate How to access a selected lookup value in a grid ticket. Please refer to it.
Ok thank you .
How to Retrieve the Value Corresponding to the Currently Selected Display Value of the RepositoryItemGridLookUpEdit???
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T189359: How to Retrieve the Value Corresponding to the Currently Selected Display Value of the RepositoryItemGridLookUpEdit???. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Would you so kind to share the solution for us all?? im also looking for the How to Retrieve the Value Corresponding to the Currently Selected Display Value of the RepositoryItemGridLookUpEdit???
Hello,
The thread in the previous comment is marked as private and I cannot make it public without its author's agreement. Therefore, I have created a separated thread on your behalf. Let us continue our discussion there GridLookUpEdit - How to Retrieve the Value Corresponding to the Currently Selected Display Value?.