Access to Visual Tree to apply custom Adorners in RichTextBoxEx

How can i attach a custom adornerer to elements in the RichTextBoxAdv (or achieve a similar result - eg add a squiggly green underline to text to indicate grammar issues). I can't figure out how to do this with RichTextBoxAdv control since the document object model elements all inerit from BaseNode which not a Visual. Is there some mechanism to access to Visual Tree of the document or a mechanism to do this via the API. The documentation for the component seems very limited.

5 Replies

VM Venkatesan Mani Syncfusion Team May 24, 2018 06:11 AM UTC

Hi Steven,

Thank you for using Syncfusion products.

Our SfRichTextBoxAdv document VisualTree is generated based on document contents. Could you please clarify us on the following? It will be helpful us to understand your requirement clearly and provide you the appropriate solution at the earliest.

1. At present our SfRichTextBoxAdv supports spellchecking and highlights the misspelled word using red squiggly underline, whether you need to customize this highlighting underline color?
2. Whether you require grammar checking functionality? Are you trying to implement custom grammar checking functionality into SfRichTextBoxAdv?

Regards,
Venkatesan M.  



SA Steven Alexander Marshall May 24, 2018 07:55 AM UTC

Thanks for your quick reply, I was just using the squiggly line as an example - what i'd actually like to do is display some form of indication around tables (and probably other elements) in a document to indicate that it is selected, or to indicate that the data which it was generated from has been modified and the element needs to be refreshed etc. (I am building a dynamic report generation tool).


VM Venkatesan Mani Syncfusion Team May 25, 2018 10:52 AM UTC

Hi Steven,

Thank you for your update.

Do you require Track Changes feature in SfRichTextBoxAdv control like Microsoft Word? We have attached a simple demo video to illustrate the Track changes feature of Microsoft Word.

Demo: Demo.zip

Please let us know if you have any other questions.

Regards,
Venkatesan M.



SA Steven Alexander Marshall May 25, 2018 01:17 PM UTC

Thankyou,
Track changes is not what i'm looking for.
In the standard RichTextbox i can use Adorners to show additional information in the document. What i want to achieve are things like the attached image where i can indicate to the user that the underlying data source for the table has been modified

Attachment: table_adorner_1a337634.zip


VM Venkatesan Mani Syncfusion Team May 28, 2018 01:44 PM UTC

Hi Steven,

Thank you for your update.

You can add the adorner to our entire SfRichTextBoxAdv control not to document content. On further analysis, we have found a workaround solution to meet your requirement.
At present, you can get the coordinates (caret position) of the selected content as Rect using the method “TextPosition.GetRect()”.
We created a simple prototype to add the adorner for selected content. Please find the prototype sample from following link,

Sample:
Sample_CustomAdorner.zip

If we provide bounds of the modified content, can you able to add and clear the adorner’s dynamically for changed contents?

Please let us know if you have any other questions.

Regards,
Venkatesan M. 


Loader.
Up arrow icon