I have this in my form's designer code:
this.referenceNumberTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientDetailBindingSource, "ClientDetails.ReferenceNumber", true));
In a method in the form just before it gets displayed I say
this.clientDetailBindingSource = passe开发者_StackOverflow社区dInBindingSource;
The controls that are databound to this.clientDetailBindingSource
do not show any data.
I have also tried doing ResetBindings() but nothing happened.
the textbox's DataBindings contains a Binding object that references the original binding source; reassigning the form's data member does not alter the Binding object already created
in other words, the textbox's binding is still bound to the old binding source
unless you're performing this assignment before the call to InitializeComponent in the form's constructor...?
精彩评论