Hello,
I have an UltraNumericEditor set to NumericType = Double and an MaskInput = "{double:2.2} mm"
If I set the Value to 1.123 the control will format the text in accordance to the MaskInput and will display "1.12 mm". Is there a way to obtain the masked text programatically? In this scenario I would get "1.12 mm".
Thanks.
The EditorWithMask embeddable editor (which the UltraNumericEditor uses) exposes a 'GetText' method which takes a valeu that allows you to specify whether you want the raw text, text with literals, text with prompt characters, etc. The caviat is that you can only use it when the control is in edit mode, i.e., when it has focus. You can force the control to always be in edit mode by setting its AlwaysInEditMode property to true if you want.
Example:if ( this.ultraNumericEditor1.IsInEditMode ){ EditorWithMask editor = this.ultraNumericEditor1.Editor as EditorWithMask; string textWithLiteralsAndPrompts = editor.GetText(Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeBoth );}
That's what I need, but I wonder if there are collateral consequences in setting AlwaysInEditMode = true.