Simple DataBinding exception: "Attempted to devide by zero."
I have a custom DatePicker control and a Business Object. I've bound a DateTime property on the Business Object to the DatePicker:
#region
BindToDatePickerprivatevoid BindToDatePicker(PSDatePicker datePicker,string propertyName)
{
if (datePicker.DataBindings.Count > 0)
datePicker.DataBindings.Clear();
datePicker.DataBindings.Add("Value",this.o_StaffMember, propertyName);
}
#endregion
The DatePicker has ValueChanged event which the simple DataBinding uses to detect changes. When Value changes I get an "Attempted to devide by zero." exception.
Stack Trace:
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
at System.Windows.Forms.BindToObject.SetValue(Object value)
at System.Windows.Forms.Binding.PullData(Boolean reformat, Boolean force)
... cut ...
It doesn't matter what value I try to set and why would using reflection to SetValue the Value property of DateTime type throw a devide by zero error anyway?
If anyone could shed some light on this issue I would be extreamly grateful.

