Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 626461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:25:18+00:00 2026-05-13T19:25:18+00:00

I have some lookupedits binded to some lists where the user can choose values

  • 0

I have some lookupedits binded to some lists where the user can choose values and then save in database. I use EditValueChanged events to handle the values. So far all good!

Now i need to grab the values from the database and assign them to the lookupedits. I don’t use BindingSource for the whole object cause lookupedits are binded to independent lists.
As i supposed and read from the documentation, SelectedText is what i need, but when I’m assigning the string i want, it just don’t work and sets an empty string. Same Behavior for the DateEdit control, I’m assigning a DateTime value and seems to have this value but doesn’t shows it. I could set the EditValue property but i get nothing showed up in the LookUpEdit again.

How to force the LookUpEdit to show me the value i want, basically go to the row with the value i set and show the text in the editor too, or set the SelectedText and match it with its list and show it!

I guess this should be easier…Any help appreciated!

Example:

myLookUpEdit.SelectedText = "George" // The LookUpEdit is Binded to a List<Names> and has the name George.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:25:18+00:00Added an answer on May 13, 2026 at 7:25 pm

    Whenever I am setting the value of a LookupEdit I use EditValue.

    You need to make sure that you set the ValueMember property of the LookupEdit to whatever you want to appear in EditValue. DisplayMember will what is displayed when the LoodupEdit is closed. You can pass in a string to the name of the property you want in your object to these properties.

    Setting the SelectedText value has the same effect as typing into the control as far as I am aware.

    public partial class Form1 : Form
    {
        List<Name> MyNames = new List<Name>();
    
        public Form1()
        {
            InitializeComponent();
        }
    
        private void Form1_Load(object sender, EventArgs e)
        {
            MyNames.Add(new Name("John", "Smith"));
            MyNames.Add(new Name("John", "Doe"));
            MyNames.Add(new Name("Jane", "Doe"));
            MyNames.Add(new Name("Jane", "Smith"));
    
            lookUpEdit1.Properties.DataSource = MyNames;
            lookUpEdit1.Properties.DisplayMember = "FirstName";
            lookUpEdit1.Properties.ValueMember = "FirstName";
    
        }
    
        private void lookUpEdit1_EditValueChanged(object sender, EventArgs e)
        {
    
            string mystring = lookUpEdit1.EditValue.ToString();
    
            lookUpEdit1.EditValue = mystring;
        }
    }
    
    public class Name
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    
        public Name(string firstName, string lastName)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have some JavaScript that assigns values to an object using $.data and then uses
Have some data in a sybase image type column that I want to use
I have some code that can convert a single color in a template image
We have some tables for domain type values, ie Customer Type, operation type etc..
I have some code that watches the event log for entry written events and
I have some issue I can't find any info about! I did a clean
We have some files on our website that users of our software can download.
Have some dates in my local Oracle 11g database that are in this format:
I have some programs that use the Net::Telnet module to connect to several servers.
I have some plain text encrypted with Triple XOR and then Triple DES. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.