KB Article A308
Visible to All Users

LookupEdit - How to retrieve a key value corresponding to the currently selected DisplayValue

Description:
How to Retrieve the Key Value Corresponding to the Currently Selected Display Value of the Lookup Editor

Answer:
To obtain the Key field value corresponding to the value displayed by the Lookup editor, simply use the EditValue property of the editor. It will return the required value.

Show previous comments (1)
DevExpress Support Team 11 years ago

    Hi,
    In case of an in-place LookUp, if the editor is active, you can use the same approach. To access the active editor in the GridView, use the GridView.ActiveEditor property. If the editor is closed, it is necessary to get its value from the Grid data source. Use the GridView.GetRowCellValue method to get a Grid cell value.

      Hi Gosha,
      Thank you for reply,
      My Goal is to fill the repository testEdits when i select any Item from repository Lookup Edit in Gridview.
      I have 3 Columns in Gridview Column1 is repositoryLookup Edit, Column2,Column3 are repository textEdits. I want to fill Column 2 and Column 3 if i select any items in Column1.
      Please help me.
      Thankyou

      DevExpress Support Team 11 years ago

        Hi,
        You posted the How to access a selected lookup value in a grid ticket devoted to this issue. Refer to it for a solution.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.