How can i set color in C1FlexGrid

Posted by: sabanaman on 7 June 2022, 3:57 am EST

    • Post Options:
    • Link

    Posted 7 June 2022, 3:57 am EST - Updated 3 October 2022, 10:26 pm EST

    i want to set color each characters in C1FlexGrid cell

    i know set color in C1FlexGrid cell

    but didn’t know how to set color each characters

  • Posted 7 June 2022, 7:26 am EST

    Hi,

    It is not directly possible to specify separate colors for each character of a cell in the C1FlexGrid. As a workaround, you will need to handle the OwnerDrawCell event of the C1FlexGrid to manually draw each character of a Cell Text with multiple colors, by using the Graphics.DrawString method. Please refer to the attached sample showing a simple implementation of the same.

    StyleEachCharacter_FG.zip

    Kind Regards,

    Kartik

  • Posted 7 June 2022, 8:35 am EST

    Or you could check the sample “RTFGrid”: https://www.grapecity.com/samples/rtfgrid

    It is probably easier to create a rtf string than rendering each char :wink:

    Best regards

    Wolfgang

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels