F
Flomo Togba Kwele
I have some comboxes and checkboxes on a UserControl, all of which are
bound to a BindingSource.
When I bound the bindingsource to the checkbox Checked property and
the user accepted the default (unchecked, false), the bindingsource
blew in the EndEdit event of the bindingsource on a null value for the
column in the dataset associated with the checkbox.
If I check the box and uncheck it before trying to save the row, the
error does not occur.
Similarly with the combos, if I select an item in the combobox at Load
time, it too gets the null error in the EndEdit event. The
bindingsource is bound to the combo's SelectedValue property. The
datasource of the combos are generic Lists of Strings, so I didn't
know what to place in the ValueMember's property.
I was forced to set the comboboxes SelectedIndex to -1 and bind the
checkboxes to the CheckedState property to force the user to change
state before saving.
There must be a better way to do this. Any suggestions?
Thanks
bound to a BindingSource.
When I bound the bindingsource to the checkbox Checked property and
the user accepted the default (unchecked, false), the bindingsource
blew in the EndEdit event of the bindingsource on a null value for the
column in the dataset associated with the checkbox.
If I check the box and uncheck it before trying to save the row, the
error does not occur.
Similarly with the combos, if I select an item in the combobox at Load
time, it too gets the null error in the EndEdit event. The
bindingsource is bound to the combo's SelectedValue property. The
datasource of the combos are generic Lists of Strings, so I didn't
know what to place in the ValueMember's property.
I was forced to set the comboboxes SelectedIndex to -1 and bind the
checkboxes to the CheckedState property to force the user to change
state before saving.
There must be a better way to do this. Any suggestions?
Thanks