【发布时间】:2015-03-16 13:23:25
【问题描述】:
我检查了以下链接中的问题: This causes two bindings in the collection to bind to the same property. Parameter name: binding error in c#?
我遵循了给定的答案。错误消失了,但出现了新问题:
有一个 DGV,当我单击它的单元格时,一些文本框会绑定到选定的行。当我点击其他行之后,它会清除 DGV 中的第一行。
代码:
this.SupportPersonnelIDtxt.DataBindings.Clear();
this.SupportCallingPersontxt.DataBindings.Clear();
this.SupportCustomerProductIDtxt.DataBindings.Clear();
this.SupportIssuetxt.DataBindings.Clear();
this.SupportServicetxt.DataBindings.Clear();
this.SupportResulttxt.DataBindings.Clear();
this.SupportDescriptiontxt.DataBindings.Clear();
this.SupportdatePicker.DataBindings.Clear();
this.SupportPersonnelIDtxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Operator", true));
this.SupportCallingPersontxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "CallingPerson", true));
this.SupportCustomerProductIDtxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Product", true));
this.SupportIssuetxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Issue", true));
this.SupportServicetxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Service", true));
this.SupportResulttxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Description", true));
this.SupportDescriptiontxt.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Result", true));
this.SupportdatePicker.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.supportTblBindingSource, "Date", true));
【问题讨论】:
-
解释你的问题更多
-
我不想清除 DGV。我该怎么做?