开发者

Only one text box updating with a databound source

I have a bunch of text boxes bound to table adapters, when I fill my datatable only one box out of all of them will fill, txtEducator (there is only one row in the datatable). They are all configured exactly the same. I have debuged and there is data in most of the fields in the datatable, it just chooses to only show the one field. (I removed non relevent code and one non-working example)

this.txtPracticeName.DataBindings.Add("Text", this.dataStore, "CLIENT_INFO.ACCOUNT", false, DataSourceUpdate开发者_JAVA技巧Mode.OnValidation, "");
this.txtEducator.DataBindings.Add("Text", this.dataStore, "CLIENT_INFO.USERNAME", false, DataSourceUpdateMode.OnValidation, "");

Here is all of the config code for the feild that works and one that is not showing anything.

this.txtEducator = new System.Windows.Forms.TextBox();
this.txtPracticeName = new System.Windows.Forms.TextBox();
...
this.tbpPIPracticeInfo.Controls.Add(this.groupBox6);
this.tbpPIPracticeInfo.Controls.Add(this.groupBox5);
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
private System.Windows.Forms.TextBox txtEducator;
private System.Windows.Forms.TextBox txtPracticeName;
this.groupBox6.Controls.Add(this.txtEducator);
this.groupBox5.Controls.Add(this.txtPracticeName);
...
// 
// txtEducator
// 
this.txtEducator.Location = new System.Drawing.Point(8, 110);
this.txtEducator.Name = "txtEducator";
this.txtEducator.Size = new System.Drawing.Size(150, 20);
this.txtEducator.TabIndex = 19;
// 
// txtPracticeName
// 
this.txtPracticeName.Location = new System.Drawing.Point(8, 34);
this.txtPracticeName.Name = "txtPracticeName";
this.txtPracticeName.Size = new System.Drawing.Size(317, 20);
this.txtPracticeName.TabIndex = 4;

I have looked everywhere. the two boxes seem identical in every way, why would only one show the information when I do this

client_infoTableAdapter.Fill(dataStore.CLIENT_INFO, txtClinicNumber.Text);
this.ValidateChildren();

putting in a Binding source and directing it through that made no difference.

EDIT -- ValidateChildren returns true; EDIT2 -- Well I dont know what I changed but txtEducator does not update either anymore.


I'm wondering what the role of these two lines is:

this.txtEducator = new System.Windows.Forms.TextBox();
this.txtPracticeName = new System.Windows.Forms.TextBox();

Why are you re-new'ing the objects at the end?


I don't know what I did diffrently but adding a binding source again solved the issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜