-1

I checked the question in the link below: This causes two bindings in the collection to bind to the same property. Parameter name: binding error in c#?

And I followed the given answer. The error is gone but there is a new problem:

There is a DGV which when I click on its cells some textboxes are bind to the selected row. When I click on other rows after that it clears the first row in DGV.

the code:

                    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));
Community
  • 1
  • 1
Amirhossein Rzd
  • 359
  • 3
  • 12

1 Answers1

0

I tried a better way. This is how I filled textboxes with the values of the selected row in a DGV.

the code:

SupportPersonnelIDtxt.Text = dataGridView7.Rows[e.RowIndex].Cells[0].Value.ToString();
Amirhossein Rzd
  • 359
  • 3
  • 12