Current filter:
                                You should refresh the page.
                                  • Hi,
                                    I have a problem using a LookupEdit and have been trying for hours:
                                    How can I display a newly inserted record as a selected item?
                                    I proceed as follows:
                                    - The user writes text to the LookupEdit if the entry does not exist yet
                                    - Call Button_Click-Event of the LookupEdit-Control (I need a plus button to add a new row)
                                    - Write new record in database
                                    - Refill the BindingSource
                                    - Then set LookUpEdit.EditValue = insertedId.
                                    Unfortunately, I always get the value that is most similar to the previously entered one and who was already stored in datatable.
                                    It works perfectly with the ComboBoxEdit control, but then unfortunately I do not get the id of the selected record.
                                    That's why I used a LookupEdit.

                                    Can you help me?

                                    Thank you!

                                • Igor (DevExpress Support) 09.10.2019

                                  Hi,

                                  Your algorithm looks correct. I tested it on my side and it works as expected. Refer to the sample in the attachment. Would you please modify it to illustrate the issue? I will examine it and do my best to find a solution.
                                  I look forward to hearing from you.

                                • Miriam S 09.11.2019

                                  Hello Igor,
                                  many thanks for your response.
                                  Please find attached the modified example.

                                  EDIT:
                                  The example works, sorry. I just tried it again. He displays the new entry. Unfortunately I still only see the similar entry in my real project.

                                  Kind regards

                                • Miriam S 09.11.2019

                                  Here is a picture of the problem, as it can not be reproduced in the modified example.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Igor,
                                the binding was wrong. I fixed the bug and have to call LookupEdit.Refresh().  Now it works!
                                Thank you for your example.
                                I'm sorry for the inconvenience.
                                Again thank you for your support

                                • Igor (DevExpress Support) 09.11.2019

                                  Hello,

                                  I am happy to hear that you have found a solution, Miriam!
                                  You are always welcome.