Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1125
Nulls in bound UltraTextEditors
posted

Hi

When a UltraTextEditor is bound via its Value property to a nullable type, highlighting the text in the control and pressing delete will cause the bound property to be set to null.  However, if the UTE is bound via its Text property instead, clearing the text results in an "Input string was not in correct format" message.  I'm guessing that's because in this case the control is trying to set the bound property to a zero length string rather than null *.  Is there anyway to change this behaviour so that clearing the text sets the bound property to null?

I know that we could just use the Value property, but we have used the formatting in the Advanced option under databindings to set the text to have a currency format (because our fussy users can't get on with the currency editor) and that formatting only works if you bind to the Text property, it doesn't do anything if the data is bound to the Value property of the UTE.

(* the attached example shows that clearing a UTE's contents will result in a null or an empty string depending on whether the control is bound via its Value or Text respectively)

NullStringBindingInUltraCombo.zip