Answer:
The following snippet shows you how you can gain access to the ErrorProvider of a control to change its properties, or replace it entirely:
// For some Control pControl, retrieve its data bindings
foreach(Binding aBinding in pControl.DataBindings) {
// Cast the binding to an IdeaBladeBinding
IdeaBladeBinding binding = aBinding as IdeaBladeBinding;
if (binding != null && binding.PropertyName == "SomeBindingPropertyName") {
// e.g. Change blinking to never blink.
ErrorProvider errorProvider = binding.ErrorProvider;
errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
// or
// e.g. Replace ErrorProvider entirely
binding.ErrorProvider = ModifiedErrorProvider;
}
}
If, however, you are interested in modifying the default exception-handling behavior of a DevForce data binding, please consult the section in the Developer’s Guide titled “Modifying the Default Error Handling Behavior of the Binding.” This section describes a couple of ways to do this as well as an example of how you can replace the ControlBindingDescriptor’s Error event with your own handler.