开发者

Why does bindingSource = newBindingSource not refresh data

开发者 https://www.devze.com 2022-12-21 00:48 出处:网络
I have this in my form\'s designer code: this.referenceNumberTextBox.DataBindings.Add(new System.Windows.Forms.Binding(\"Text\", this.clientDetailBindingSource, \"ClientDetails.ReferenceNumber\", tru

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...?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号