【发布时间】:2010-01-21 17:23:38
【问题描述】:
我有一堆文本框绑定到表格适配器,当我填充我的数据表时,只有一个框会填充,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; EDIT2 -- 我不知道我改变了什么,但 txtEducator 也不再更新了。
【问题讨论】:
标签: c# winforms data-binding