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

Is it possible to save and restore the cursor (caret) position of RTF document?

I'm saving the contents of a RichTextBoxAdv as RTF, I would like to be able to restore the cursor to the position when re-loading this document.  Is this possible?

Thank you.

4 Replies

PS Premkumar Sundaramoorthy Syncfusion Team December 9, 2019 06:01 PM UTC

Hi John, 
 
Thank you for using syncfusion product, 
 
The file format file (.rtf) should contains the content information alone. It won’t contain any information about application level information, for example cursor position selection highlight etc. Because it is differing for each viewer and editor. So, save and restore the cursor position is not possible.  
But as a workaround you can place the cursor at specific position on loading each document by holding the caret position in sample level. Now we are preparing the sample for the same will update the sample by 12/10/2019.  
 
Please let us know if you need any other question. 
  
  
Regards, 
Premkumar 



PS Premkumar Sundaramoorthy Syncfusion Team December 10, 2019 12:28 PM UTC

Hi John,



We have prepared the sample to demonstrate how to store and restore the cursor position on loading each document.

Sample link: https://www.syncfusion.com/downloads/support/forum/149734/ze/Restore_CaretPosition-632679514 


Please let us know if you have any other question.





Regards,

Premkumar 



JP John Prass December 10, 2019 11:22 PM UTC

This workaround will work for me.  Thank you for your help.


PN Preethi Nesakkan Gnanadurai Syncfusion Team December 11, 2019 09:22 AM UTC

Hi John, 
  
Most welcome. 
  
Regards, 
Preethi 


Loader.
Live Chat Icon For mobile
Up arrow icon