How to load RTF content in Reach Text Editor

Hi,

I want to read the RTF string from database and load the same in the rich text editor in read only mode, is it possible with RTE control? if yes then how?

Thanks in advance. Appreciate any help on this.

Regards,

Atif  


1 Reply

IS Indrajith Srinivasan Syncfusion Team November 18, 2021 01:25 PM UTC

Hi Atif, 
 
Greetings from Syncfusion support, 
 
We have validated your reported query “RTF string from database and load the same in the rich text editor in read only mode, is it possible with RTE control? if yes then how?”. You can enable and disable the Rich Text Editor readonly property dynamically, to achieve your requirement. We have prepared a sample inserting the text in the editor and making the editor readOnly once inserted. Check the below shared sample and code blocks for reference. 
 
 
buttonClick() { 
    this.rteObj.readonly = false; 
    this.rteObj.dataBind(); 
    this.rteObj.executeCommand('insertHTML''<p>Test</p>'); 
    this.rteObj.readonly = true; 
    this.rteObj.dataBind(); 
  } 
 
 
 
Please let us know if the solution helps, 
 
Regards, 
Indrajith 


Loader.
Up arrow icon