Ticket Q301756
Visible to All Users

html color in xtragrid richtextedit

created 14 years ago

Hello,
I want to display HTML text in a grid view, with the formatting and have reviewed the documentation. I have seen that you can use a RichTextEdit and set the documentFormat property to HTML. I can get bold text to show, using strong, but I cannot get the font color to change. I have read the documentation and have tried all the different types but to no avail, what am i doing wrong.
Examples tried :
<strong><color=255,0,0>Bold and Colour Red</color></strong> Plain Text
and
<strong><color=blue>Bold and Colour Blue</color></strong> Plain Text
and in this case when introducing the word font, nothing appears at all
<strong><Font color=255,0,0>Bold and Colour Red</color></strong> Plain Text
Have also tried using a hex code based on advise in the forums but still to no avail.
What am i missing?
Thanks in advance

Show previous comments (2)
Alessandro (DevExpress Support) 14 years ago

    Hello Frank,
    Thank you very much for the clarification. I completely understand your scenario. Basically, there is no "color" tag in the standard HTML specification. You should use the font tag with the color attribute for this purpose: HTML <font> Tag. Thus, you might need to update your example as follows: "<strong><font color='#FF0000'>Bold and Colour Red</font></strong> Plain Text". Attached is a sample, demonstrating how this works in the RichEditControl. As for the "color" tag, it is our own invention that is used in the HTML Text Formatting. If any part of my response is unclear, please let me know. I will be glad to help you.
    Thanks,
    Alessandro.

      I had tried that but it is still not working. I have created a small example app and it is attached. I have created a dummy table for this example, but my data will normally come straight from the database.
      Hopefully from the attached you can see the issue I am having

      Alessandro (DevExpress Support) 14 years ago

        Hello Frank,
        Thank you for your sample. Here are my comments:

        1. "<color='#98FB98'><strong>this should be strong and colored</strong></color> plain text" - this will not work correctly (see my previous answer).
        2. "<font color='#98FB98'><strong>this should be strong and colored</strong></font> plain text" - the resulting string does not fit the row height. You just need to set the GridView.OptionsView.RowAutoHeight property to true to fix this problem. See also: RichTextedit.
          Thanks,
          Alessandro.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.