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
Forums Home / ComponentOne / WinForms Edition
Posted by: sabanaman on 7 June 2022, 3:57 am EST
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.
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
Best regards
Wolfgang