RadRichtextbox Insert text into active header/footer

1 Answer 188 Views
RichTextBox
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Kamran asked on 12 Jul 2021, 04:51 PM

I am Inserting placeholder (text data) from ListBox (double click and drag/drop) into RadRichtextBox.

In document section I can insert Placeholders in editor by 


radRichTextBoxEditor.Insert($"{{{{{lookup.Code}}}}}");

Now I want to insert text in Header/Footer in current CaretPoistion.

1. How I can Identify that Header/Footer or main document section is currently active

2. How to insert text in header if Caret Position in header, and same for footer

1 Answer, 1 is accepted

Sort by
0
Accepted
Tanya
Telerik team
answered on 13 Jul 2021, 01:45 PM

Hi Kamran,

You can use the ActiveDocumentEditor property of RadRichTextBox. It gives you information about the document part the caret is currently on and can be used to directly insert content in this part:

IDocumentEditor activeEditor = radRichTextBox.ActiveDocumentEditor;
activeEditor.Insert("sample content");

Regards,
Tanya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RichTextBox
Asked by
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Tanya
Telerik team
Share this question
or