I have a simple form bound to a data table. The code was copied from a program that works, and everything about the new form works except the "Add New" functionality.
Clicking the "Add New" button executes this code:
The behavior I see is that:
The bound controls do not automatically reset to blank values like they should.
A row is added (myBindingManager.Count is incremented) but changing the position of the binding manager
to that row (myBindingManager.Position ++) doesn't work; it refuses to advance to the new row.
After fooling around a bit, I discovered that the hangup seems to be that I have added a DataTimePicker control and bound it to a DateTime type column:
myDateTimePickerControl.DataBindings.Add (new Binding("Value", dsMyDataSet, "tablename.datetimecolumnname"));
When changing the binding manager position to move through the rows everything works fine if there is a value in the column, but if it is null (as it is when a new record is added) the binding manager chokes.
1. How can I set up my binding to handle null values in the columns, and
2. Which column types besides DateTime will probably be set to null on an Add.New()?