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

How to detect current page at caret

2 Answers 81 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 Nov 2013, 11:17 PM
Hi,

What's the best method to determine the current page number at the caret position or even a specified position?

I'm using library version 2013.1.220.40.

Thanks,

Rob

2 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 11 Nov 2013, 05:30 PM
Hello Rob,

You can obtain the page number based on a DocumentPosition as follows:
SectionLayoutBox sectionBox = position.GetCurrentSectionBox();
int pageNumber = sectionBox.PageNumber;

Let me know if you have additional questions or comments.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Robert
Top achievements
Rank 1
answered on 12 Nov 2013, 11:39 AM
Thanks Petya,

I will give this a try sometime next week.

Many thanks for your help,

Rob
Tags
RichTextBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Petya
Telerik team
Robert
Top achievements
Rank 1
Share this question
or