I bind my textboxes using the databindings like so: txtCustomer.Databindings.Add (New Bindings ("Text", dsCustomer, "Customer.CustName"))
My problem is how to remove the databinding. I know there is a property txtCustomer.Databindings.Remove (.....)
but I don't know what should go inside the parameters!!
ADAdministrator Syncfusion Team June 22, 2002 06:11 AM UTC
in my form_load i bind all the data to the textbox as such..
txt1.databindings.add(New Bindings ("Text"), dsTest, "Test.TestName")
But I have a combo box where the user can select the year of the test they want to view. For example, if they want to view 1997's test scores then the textboxes should show all of that year's test scores. If they change the year to 1998, then the databindings should change accordingly. I know I have to remove the databindings each time they change the combobox value.. but i'm getting an error if i do this:
txt1.databindings.remove (New Bindings("Text", dsTest, "Test.TestName")
CBClay Burch Syncfusion Team June 22, 2002 04:07 PM UTC
When you use the Remove, you want to remove an existing Binding, so you do not want to use
txt1.databindings.remove (New Bindings("Text", dsTest, "Test.TestName"))
as this creates a new Binding (because you are using the New keyword). Instead, you want to get the existing binding, and pass that as the argument. So, try something like