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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:58:39+00:00 2026-06-15T06:58:39+00:00

I do DataBinding in the following way private List<MyEditor> Editors { get; set; }

  • 0

I do DataBinding in the following way

    private List<MyEditor> Editors { get; set; }
    private Dictionary<int,object> dictionary

    private void SetEditors()
    {
        Editors.Clear();

        foreach (var element in dictionary)
        {
            var editor = MyFactory.GetEditor();
            editor.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
            editor.DataBindings.Add("Value", element, "Value");

            //some code

            Editors.Add(editor);

        }

        //some more code
    }

Then in GUI I do some changes to Value of Editors[0], after that in another piece of code I try to get value from dictionary element and find out that it hasn’t changed, even though I use Editors[0].DataBindings["Value"].WriteValue() to ensure data is written to dictionary.

In debugger I can see the following picture:

    Editors[0].DataBindings["Value"]    {System.Windows.Forms.Binding}  System.Windows.Forms.Binding
            ....
    DataSource  {[0, oldValue]} object {System.Collections.Generic.KeyValuePair<int,object>}
            ....

while

    Editors[0].Value    "newValue"  object {string}

What could it be? Will be grateful for any ideas.

  • 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-15T06:58:42+00:00Added an answer on June 15, 2026 at 6:58 am

    I’m not certain I’m following correctly, but I believe the answer is that when you enumerate a Dictionary, the KeyValuePair (KVP) objects you get are created at the time of the enumeration. Enumerate it again and you will get a different set of objects. This is because a KVP is a value type.

    To alter something referred to by a KVP, you have to return to the original Dictionary object. A data binding does not do that.

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

Sidebar

Related Questions

I am getting the following error Databinding methods such as Eval(), XPath(), and Bind()
I'm trying to test DataBinding within a WinForm application. The following test case fails.
I am databinding a GridView to an object datasource. The gridview contains a TemplateField
The project I came into manages databinding like this: Default object is loaded on
I'm wondering how one could use template databinding to accomplish what the following code
I'm working with Databinding in ASP.Net 2.0, and I've come across an issue with
any good recommendations for databinding. i am starting to look into WPF more and
When doing databinding does one have to implement INotifyPropertyChanged on the datacontext in WPF?
I am using databinding and IDataErrorInfo style validation in a form. This form includes
To do DataBinding of the Document in a WPF RichtextBox , I saw 2

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.