Is it possible to use the UltraFormattedTextEditor to handle its value as raw text i.e. if I set "A B" as a value for a cell the grid displays this as exactly as "A B" (three spaces between A and B)? My current tests show that the spaces are always condensed in the display (although the value continues to have the three spaces).
The documentation here talks about a possibility to use the TreatValueAs enum to indicate that the values should be considered as raw text - however, the enum only as FormattedText, URL and Auto. None of these seem to assume raw text.
You might argue that I could use UltraTextEditor instead of UltraFormattedTextEditor but in fact that editor behaves very different regarding focus handling and various other things that we are currently discovering after I replaced UltraFormattedTextEditor by UltraTextEditor.
So ideally I can make UltraFormattedTextEditor behave like UltraTextEditor regarding how it translates text to value and vice versa.
Can that be done?
You can either open the Value Editor and edit the value as A B(three spaces between A and B) or enter A&edsp;&edsp;&edsp;B into Value property to get the expected result like in the screenshot.
Well, the use case is more like:
- I bind the grid to some data source
- the data source knows nothing about the formatting (so no &edsp; values will be in the string)
- nevertheless I want the data to be displayed as in the data source (3 spaces)
- when I enter values with spaces into the grid I want them in the data without any formatting decoration (text as is)
What I found out today is:
- if TreatValueAs is set to Auto it works in this direction (bound data is properly rendered in the cell)
- if I set the UpdateMode of the grid to OnCellChange values entered in the editor are transferred correctly (for my use case) into the bound data
This looks all pretty unexpected to me but in the end I have what I need.