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

  • Home
  • SEARCH
  • 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 122647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:09:42+00:00 2026-05-11T04:09:42+00:00

I am having virtually the same problem as this: C# Update combobox bound to

  • 0

I am having virtually the same problem as this:

C# Update combobox bound to generic list

However, I am trying to change the displayed strings; not add, remove, or sort. I have tried the BindingList solution provided in the referenced question, but it has not helped. I can see the combobox’s DataSource property is correctly updated as I edit the items, but the contents displayed in the combobox are not those in the DataSource property.

my code looks as follows:

mSearchComboData = new List<SearchData>(); mSearchComboData.Add(new SearchData('', StringTable.PatientID)); mSearchComboData.Add(new SearchData('', StringTable.LastName)); mSearchComboData.Add(new SearchData('', StringTable.LastPhysician)); mSearchComboData.Add(new SearchData('', StringTable.LastExamDate));  mBindingList = new BindingList<SearchData>(mSearchComboData);  SearchComboBox.Items.Clear(); SearchComboBox.DataSource = mBindingList; SearchComboBox.ValueMember = 'Value'; SearchComboBox.DisplayMember = 'Display';  ... 

When I try to update the content I do the following:

int idx = SearchComboBox.SelectedIndex; mBindingList[idx].Display = value; SearchComboBox.Refresh(); 

EDIT::

RefreshItems seems to be a private method. I just get the error message:

”System.Windows.Forms.ListControl.RefreshItems()’ is inaccessible due to its protection level’

ResetBindings has no effect.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T04:09:43+00:00Added an answer on May 11, 2026 at 4:09 am

    If you were to change the entire object, meaning your entire SearchData object, then the bindinglist would have knowledge of this change, and therefore the correct events would internaly get fired, and the combobox would update. HOWEVER, since you’re only updating one property, the bindinglist has no idea that something has changed.

    What you need to do is have your SearchData class implement INotifyPropertyChanged. Here’s a quick sample I wrote to demonstrate:

    public class Dude : INotifyPropertyChanged     {         private string name;         private int age;          public int Age         {             get { return this.Age; }             set             {                 this.age = value;                 if (this.PropertyChanged != null)                 {                     this.PropertyChanged(this, new PropertyChangedEventArgs('Age'));                 }             }         }         public string Name         {             get             {                 return this.name;             }              set             {                 this.name = value;                 if (this.PropertyChanged != null)                 {                     this.PropertyChanged(this, new PropertyChangedEventArgs('Name'));                 }             }         }          public event PropertyChangedEventHandler PropertyChanged;       } 

    And here’s some code to test:

            private void button1_Click(object sender, EventArgs e)         {             //Populate the list and binding list with some random data               List<Dude> dudes = new List<Dude>();             dudes.Add(new Dude { Name = 'Alex', Age = 27 });             dudes.Add(new Dude { Name = 'Mike', Age = 37 });             dudes.Add(new Dude { Name = 'Bob', Age = 21 });             dudes.Add(new Dude { Name = 'Joe', Age = 22 });              this.bindingList = new BindingList<Dude>(dudes);             this.comboBox1.DataSource = bindingList;             this.comboBox1.DisplayMember = 'Name';             this.comboBox1.ValueMember = 'Age';          }       private void button3_Click(object sender, EventArgs e)     {         //change selected index to some random garbage         this.bindingList[this.comboBox1.SelectedIndex].Name = 'Whatever';     } 

    Since my class now implements INotifyPropertyChanged, the binding list gets ‘notified’ when something changes, and all this will thus work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 131k
  • Answers 131k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem with (publicly-)anonymous reviews on the internet is that… May 12, 2026 at 6:20 am
  • Editorial Team
    Editorial Team added an answer I think it's best to keep it simple, perhaps something… May 12, 2026 at 6:20 am
  • Editorial Team
    Editorial Team added an answer All of these answers are too verbose. Yes, Tomcat is… May 12, 2026 at 6:20 am

Related Questions

I actually have two questions regarding the same problem but I think it is
I am trying to import a column of dates from a spreadsheet in Excel
I am having a tough time deploying a web site to IIS 7 on
I am having a really bad issue where no matter what I try, the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.