Hello,
I'm writing a WinForms app, and am trying to bind a boolean property on a .NET object to a Checkbox's "checked" property. I am successfully creating the binding, but when I change the source property's value from false to true (I have a button that toggles it), the checkbox's "checked" property does not reflect that change.
if (chkPreRun.DataBindings["Checked"] == null)
{
Debug.WriteLine("Adding chkPreRun databinding");
Binding _binding = chkPreRun.DataBindings.Add("Checked", NwmConfig, "PreRun")
// Added this just to ensure that these were being set properly
_binding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
_binding.ControlUpdateMode = ControlUpdateMode.OnPropertyChanged;
}
I am able to successfully bind the text property to the value of a TextBox, for example. I'm not sure what I'm missing while binding to the "Checked" property, however.
Cheers,
Trevor