我有一堆綁定到表適配器的文本框,當我填充我的數據表時,只有一個框中的所有將填充,txtEducator(只有一行在數據表)。它們都配置完全相同。我已經放棄了,數據表中的大部分字段都有數據,它只是選擇只顯示一個字段。 (我刪除非培訓相關的代碼和一個非工作的例子)只有一個文本框更新與數據綁定源
this.txtPracticeName.DataBindings.Add("Text", this.dataStore, "CLIENT_INFO.ACCOUNT", false, DataSourceUpdateMode.OnValidation, "");
this.txtEducator.DataBindings.Add("Text", this.dataStore, "CLIENT_INFO.USERNAME", false, DataSourceUpdateMode.OnValidation, "");
這裏是所有的配置代碼爲未顯示任何工作費爾德和一個。
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;
我已到處尋找。兩個盒子在各方面都似乎是相同的,爲什麼只有一個顯示信息時,我做這
client_infoTableAdapter.Fill(dataStore.CLIENT_INFO, txtClinicNumber.Text);
this.ValidateChildren();
投入綁定源,並通過指揮它並沒有區別。
編輯 - ValidateChildren返回true; 編輯2 - 嗯,我不知道我改變了什麼,但txtEducator不再更新。
此代碼是從frmMain.designer.cs代碼複製的,我把我的複製和粘貼混淆了它本應該在頂部。我正在糾正它。 – 2010-01-21 17:49:53