FlexGrid - Show RTF Formatted text

Posted by: mwebster on 1 May 2019, 1:22 am EST

    • Post Options:
    • Link

    Posted 1 May 2019, 1:22 am EST

    I have an application that makes extensive use of Flex Grids. On several grids, I am showing a “notes” field than contains RTF formatted text - such as bold, etc. I am trying to sort out how to have the Flex Grid display the RTF formatted values instead of the raw text containing the RTF formatting codes. Any suggestions?

    Thanks,

    Mike

  • Posted 1 May 2019, 3:26 pm EST - Updated 3 October 2022, 1:25 pm EST

    Hello Mike,

    We have a product sample ‘RTFGrid’ that demonstrates how to show RTF formatted text in grid cells.

    The sample uses a class ‘RTF’ (inherited from standard RichTextBox) for rendering RTF text through OwnerDrawCell event. Also, it can be set an editor for any specific column(s).



    Therefore, I’d suggest you to refer the sample (installed at default ComponentOne location ‘…\Documents\ComponentOne Samples\WinForms\C1FlexGrid\CS’) to meet your requirement.

    Let me know, if you face any issues or have any further requirements.

    Thanks,

    Ruchir

  • Posted 2 May 2019, 2:22 am EST

    Thanks I will check it out.

  • Posted 12 June 2022, 10:23 pm EST

    Hi Ruchir, can you send me this sample?

    Thanks

  • Posted 12 June 2022, 10:32 pm EST

    Here is the sample attached.

    RTFGrid.zip

  • Posted 25 October 2022, 1:46 am EST

    When i set Flexgrid.AllowFilterung to true, the filter criteria is the code in rtf "{\rtf 1" and not the plain text. is there any solution in progress?

    Thanks

  • Posted 26 October 2022, 6:01 pm EST

    Hi,

    The RTFGrid sample provided above uses the OwnerDrawCell feature of FlexGrid. It applies custom rendering logic to show the raw RTF text as formatted text.

    Similarly, for Filtering, You can implement a custom column filter for the RTF column. Please refer to the sample attached.

    Regards.

    RTFGrid_Filter.zip

Need extra support?

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

Learn More

Forum Channels