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
3550
Color cell partially
posted

Inside a cell I have a text: "10,000,000-USD"

I want to color in red just part of the text.

 e.g. only the USD will be in red and the number will be

black.

  • 469350
    Offline posted

    Hi,

    Two have two different forecolors in the same cell, you either need to use FormattedText or a DrawFilter to draw the text yourself.

    FormattedText is probably easier. You just change the column's Style to FormattedText and then the Value of the cell has to return custom XML with the formatting you want.

    To learn about the custom XML formats available, check out the documentation for the WinFormattedTextEditor contorl (or UltraFormattedTextEditor). Or just put one on a form and use the designer to create the text you want and look at the XML that generates that text. It's pretty straightforward.

    Of course, your column will have to use a String DataType to get this to work, so you might want to hide the real column data and use an unbound column to display it to the user.