Databinding a Checkbox

J

Joshua Ellul

Hi There,

I am having a problem databinding a checkbox.

I databind the checkbox normally as follows:
myCheckbox.DataBindings.Add("Checked", myDS, "MyTable.MyField")

The databinding works fine as regards populating the data however when the
..AddNew() method is called nothing happens,

If I remove the databinding on the checkbox the .AddNew method works
normally (seen in the other controls), but if the checkbox is bound it
doesn't work...


I had the same problem with the DateTimePicker (and reluctantly solved it by
binding the text property rather than the value property)

Any ideas?

Josh
 
G

Guest

I beleive that checkboxes/radio buttons need default
values for the DataColumn to allow them to be bound
correctly when you call addnew on the currencymanager.

example:
myTable.Columns["my_column_name"].Default = true;
 
J

Joshua Ellul

Thank's alot!

Josh

I beleive that checkboxes/radio buttons need default
values for the DataColumn to allow them to be bound
correctly when you call addnew on the currencymanager.

example:
myTable.Columns["my_column_name"].Default = true;

-----Original Message-----
Hi There,

I am having a problem databinding a checkbox.

I databind the checkbox normally as follows:
myCheckbox.DataBindings.Add("Checked", myDS, "MyTable.MyField")

The databinding works fine as regards populating the data however when the
..AddNew() method is called nothing happens,

If I remove the databinding on the checkbox the .AddNew method works
normally (seen in the other controls), but if the checkbox is bound it
doesn't work...


I had the same problem with the DateTimePicker (and reluctantly solved it by
binding the text property rather than the value property)

Any ideas?

Josh


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top