Bug Report B207643
Visible to All Users

LookUpEdit - Problem with duplicated records

created 13 years ago

I have a lookup edit in my software and I have had clients create duplicate entries in the database and need to be able to modify that or remove the duplicate but there is an issue. For example:
Sammy Hale with a database id of 1
Sammy Hale with a database id of 34
and the user wants to remove the second one with the id of 34 using the lookupEdit1.GetColumnValue("id") it will always give you the id of 1
Why?

Show previous comments (2)
DevExpress Support Team 13 years ago

    Hello Sammy,
    This behavior is caused by the fact that the ValueMember property is set to a non unique value. The LookUpEdit control gets a value from the ValueMember column and store it to identify the selected record. If in your application, ValueMember is set to a non unique value, the LookUpEdit cannot identify which of the duplicated records have been selected. To solve the issue, set the ValueMember property to the ID column which provides unique keys.
    Thanks,
    Constant

      Ok…thanks…I will try that…

      DevExpress Support Team 13 years ago

        Feel free to contact us if you need any additional assistance regarding this. We will be happy to help you.
        Thanks,
        Constant

        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.