We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Databindings

Thread ID:

Created:

Updated:

Platform:

Replies:

403 Jun 21,2002 05:38 PM Jun 22,2002 12:07 PM Windows Forms 2
loading
Tags: FAQ
Administrator [Syncfusion]
Asked On June 21, 2002 05:38 PM

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!!

Administrator [Syncfusion]
Replied On June 22, 2002 02:11 AM

in my form_load i bind all the data to the textbox as such.. dataadapter.fill(dsTest, "Test") 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")

Clay Burch [Syncfusion]
Replied On June 22, 2002 12:07 PM

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 txt1.databindings.remove(txt1.databindings("Text"))

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;