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 4052584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:20:17+00:00 2026-05-20T14:20:17+00:00

I have a list of custom objects which I have added to a ListBox

  • 0

I have a list of custom objects which I have added to a ListBox control in my WinForms C# 4.0 application.

When the user selects a particular element in the ListBox, the properties of that object come up in the window next to the ListBox in various input fields. The user can change these and click ‘Save’ which will modify the data members of the objects to correspond with the changes the user has made.

The function does work. The values are saved to the object, and when the user selects the element again, their changes are confirmed to be saved correctly.

What isn’t working is the update of the text in the ListBox. For example if we have a list of staff in the ListBox, and we can see “John Smith” there, we can click his name – edit his name to “John Smithe” and click OK. The ListBox still shows “John Smith”, however if we click on his name, then in the TextBoxes on the right we can see that his name has correctly been changed to “John Smithe”.

I have tried calling the Refresh() method on the ListBox but this didn’t work.

I can fix it by removing the item from the ListBox and adding it again. This works, and it’s not really an issue because the items are stored in separate lists anyway so I have no risk of losing any of my staff.

But is this really the best way to do it? Is there a more elegant way to update the text in the ListBox without removing/adding the item again?

  • 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-20T14:20:18+00:00Added an answer on May 20, 2026 at 2:20 pm

    Do the objects in the ListBox implement INotifyPropertyChanged?

    Update:

    It seems that you can solve the problem with a couple of steps:

    1. Set the DisplayMember property of the ListBox to a property on your objects that provides whatever it is you want to appear in the list. I will assume this property is named DisplayText for this answer.
    2. Have the objects implement INotifyPropertyChanged.
    3. In the setters of all the properties that influence the value of DisplayText, raise the NotifyPropertyChanged event with DisplayText for the property name.

    You should then be good to go.

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

Sidebar

Related Questions

I have a core data application which displays a list of custom objects, each
I have a list of custom objects. These objects have 2 datetime properties on
I've got a GridView control which is bound to a List of custom objects.
I have a Generic List of objects that I've bound to a custom control.
I have a strongly typed list of custom objects, MyObject , which has a
I have a list of custom objects List and I would like to update
I have one custom action (add) and two custom objects (favorites list) and (tv
I have a custom list, and I've added a 'Page Image' field by clicking
I have a List<> of custom objects. This custom type has a property called
I have a list of custom objects called EntertainmentEvent: public class EntertainmentEvent { public

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.