We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

REGD--Find-Replace Dialog

Hi Clay, We found one problem while working with Find & Replace Dialog.If the cell contains Rich Text and when we replace part of text with some other text its taking away the Rich Text functionality of remaining text also.For example cell contains "Good Morning" , morning is in bold i can''t make it bold here.when i replace "Good" with "Something" morning is loosing bold. Regards, Manohar B.

3 Replies

AD Administrator Syncfusion Team April 1, 2005 10:09 AM UTC

How are you getting the RichText into the cell? What CellType are you using? The renderer for the CellType has a virtual method, ReplaceText, that the GridFindReplaceDialogSink calls to do the replacement for the particular CellType. So, to handle replacing richtext in a way that preserves the formatting (and anything else you want preserved), you would derived the cell control (meaning deriving both the CellModel class and CellRenderer class). In your derived renderer class, you would override ReplaceText to do what is necessary depending upon the cell type you are using.


MA manohar April 4, 2005 12:16 PM UTC

Hi, The cell type being used is RichText. I am currently using version 3.0.1.0. The replace ignores the richtext formating when replacing the text (it removes the formating totally including the text that is not being replaced. The entire RTF text is replaced by a new Text without any formating) Regards Manohar >How are you getting the RichText into the cell? What CellType are you using? > >The renderer for the CellType has a virtual method, ReplaceText, that the GridFindReplaceDialogSink calls to do the replacement for the particular CellType. > >So, to handle replacing richtext in a way that preserves the formatting (and anything else you want preserved), you would derived the cell control (meaning deriving both the CellModel class and CellRenderer class). In your derived renderer class, you would override ReplaceText to do what is necessary depending upon the cell type you are using. >


AD Administrator Syncfusion Team April 4, 2005 05:43 PM UTC

Here is a minimal sample showing how you can derive the cell control and handle this problem by overriding ReplaceText. http://www.syncfusion.com/Support/user/uploads/GC_RTF_Replace_4259d618.zip

Loader.
Live Chat Icon For mobile
Up arrow icon