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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:14:27+00:00 2026-06-11T12:14:27+00:00

I bind a property to a textbox control (Windows form program), using the following

  • 0

I bind a property to a textbox control (Windows form program), using the following code:

textBox.DataBindings.Add("Text", myObject, myPropertyName, false, DataSourceUpdateMode.OnPropertyChanged);

Further along in the program, I update the value of the property by reflection – using this code.

PropertyInfo propertyInfo = myObject.GetType().GetProperty(myPropertyName);
propertyInfo.SetValue(myObject, myNewValue, null);

The property’s value is being updated in the object. I can see it in the debugger, when the code returns to the form. However, the textbox does not show the new value.

If I clear the databinding on the textbox, and re-add it, it does show the new value.

How can I get the databound textbox to automatically display the new value, after setting the property value by reflection?

  • 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-06-11T12:14:28+00:00Added an answer on June 11, 2026 at 12:14 pm

    Does the binding work if you set it not using reflection? If it is still not working then you probably need to have your object implement INotifyPropertyChanged and then in your setter you need to raise the OnPropertyChanged event. This is how it works in WPF, I presume windows forms is the same or similar. Basically the binding needs a way to know that the property has changed, it does so by handling that event.

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

Sidebar

Related Questions

I'm using the following code to bind the RichTextBlock.Visibility property to another control's FocusState
I wanted to create a control with a TextBox and to bind TextBox.Text property
I am trying to bind the Text property of an <asp:TextBox /> control to
I'm trying to bind a simple one-line string to a textbox's text property but
I need to bind a property of a UserControl directly to another control, rather
I have created a custom control but I can't bind a property to the
When i do something like this: public static void BindData<T>(this System.Windows.Forms.Control.ControlCollection controls, T bind)
Is it possible to bind something to a property of a control in a
I have a ListView in a Windows Form that I bind a list of
What is the best way to bind a property to a control so that

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.