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
935
How to change editor text value before edit mode?
posted

I am using a derived UltraTextEditor to allow users to edit numbers in various free form formats. When rendering the value, the decimal places are truncated. When editing, all decimal places need to be shown. Then when user edits and leaves Edit mode, the string is converted back to a value.

For example, value = 1.2345678 shows as 1.23. When the user starts to edit, the value needs to be shown as 1.2345678 such that the user edits the actual value. Else with no edits, there is a round trip error when the string converts to the value as 1.23.

How do I refresh the editor's text when entering edit mode. I have overridden the OnBeforeEnterEdit event and have tried changing the UltraTextEditor.Text, the Editor.Text and Editor.Textbox.Text. None seem to trigger the editor to redisplay. I am using a DataFilter to format the text in the Editor -> Display conversion. The DataFilter is not called to do the any conversion when EnterEditMode.

Any suggestions? Thanks,

Wendy

Parents
  • 48586
    posted

    Hello ,

    If you are using UltraNumerickEditor for example, you could set  NumerickType to "Double", then to set MaskInput to  “{double:-9.4:c}” in order to allows user to enters decimal values with 4 digits after decimal separator. MaskImput will be applied by default, when editor is in edit mode. Then you could set FormatString property to “#.00” in order to display editor's value with 2 digits after the decimal separator. FormatString will be used of editor in order to displays actual value of the editor in specific format, when it is not in edit mode. So you will be able to have a decimal value with 4 digits after decimal separator, when editor is in edit mode and you will display decimal value with 2 digits after decimal separator when editor is not in edit mode.

    Please let me know if you have any further questions.

Reply Children