This is a migrated thread and some comments may be shown as answers.

Counting characters

1 Answer 63 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 09 Dec 2014, 09:36 PM
Does anyone know if with the RTF Editor you have the ability to count the number of characters. What I need to be able to do is insert an external file and count the total characters typed into the editor minus the count of the inserted file. Also If portions of the inserted file are changed be able to add the changed characters to the total count.

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 12 Dec 2014, 12:55 PM
Hi Frank,

Thank you for writing.

You can get statistics for any document that is loaded into a RadDocument instance. To get the stats for the currently opened document, you can execute the following line of code:
this.radRichTextEditor1.Document.GetStatisticsInfo();

The method returns a DocumentStatisticsInfo object with information on the count of pages, sections, words, characters, spaces, paragraphs and lines. 

To get the characters for the document you are inserting insert, you can get the statistics after you import it using one of the format providers.

I hope this will be useful. Should you have further questions, I would be glad to help.

Regards,
Ivan Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
RichTextEditor
Asked by
Frank
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or