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
365
ColumnStyle.FormattedTextEditor whitespace display issue
posted

I am using the FormatterTextEditor ColumnStyle on a column in my Infragistics WinGrid.  In addition, I have the CellDisplayStyle set to PlainText.  We the grid loads the text appears correctly with regard to whitespace.  Single spaces appear as single spaces and multiple spaces between words appear as multiple spaces.  However, when the user clicks into the cell and the cell is in edit mode multiple spaces no longer appear correctly.  For instance if there are three spaces between words in the text when the cell is not in edit mode, those three spaces appear as a single space when the cell is in edit mode.

I want the be able to dispay the text correctly, with the actual number of spaces (whitespaces) reflected in the text when the cell is in edit mode.

Is there any way to keep the Formatted Text Editor from supressing the extra whitespace when a cell is in edit mode?

Parents
No Data
Reply
  • 37774
    Suggested Answer
    posted

    The FormattedTextEditor deals with a custom XML format when parsing its values, so it seems like the spaces are being treated as a single space when the editor parses the value.  I'm not sure if this is the intended behavior in this case, so it would be worth submitting the issue to Developer Support so that it can be further investigated.

    If you use a standalone UltraFormattedTextEditor and use the UITypeEditor to set the Value property at design-time, you'll see that the space characters are actually replaced with "&edsp;", which is the XML-encoded value of a space, causing it to be preserved.  One workaround that you could use is to create an unbound column in the grid, hide the bound column, and in the InitializeRow event you could copy over the value to the unbound column, replacing all space characters with "edsp;".

    I believe that you're seeing the normal spaces when the cell isn't in edit mode because using the PlainText CellDisplayStyle does not use the FormattedTextEditor to display the value, so it's just going to show the text as-is.

    -Matt

Children
No Data