I have a databound NumericUpDown-Control, bound like this:
Binding b = new Binding("Value", myDataSource, "myProperty");
b.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
numericUpDown.DataBindings.Add(b);
Changing myProperty has some further effects and might throw an exception somewhere further down.
Some of the information needed to check if the Exception will be thrown is not available in the GUI, so validating the input is difficult.
Can I catch the exception triggered by the value change my DataBinding makes? Or is this a bad Design? If so, should I rather make all necessary information available to be able to validate the input correctly, or should I not use DataBinding for making complex changes?
I would greatly appreciate any help!
richn
Databinding should not be against complex properties.
Validation should be done when retrieving and setting the property.