Page count in WPF Rad Document

3 posts, 0 answers
  1. Andrew
    Andrew avatar
    13 posts
    Member since:
    Feb 2015

    Posted 09 Jun 2015 Link to this post

    Is there any easy way to get the current page count from a WPF RadDocument that is set to layout Paged?
  2. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 10 Jun 2015 Link to this post

    Hi Andrew,

    You could check the PageNumber property of the last SectionLayoutBox element in order to obtain the count of the pages in a RadDocument. Please, check the snippet below, which demonstrates how this could be achieved:
    SectionLayoutBox lastSectionLayoutBox = (SectionLayoutBox)this.radRichTextBox.Document.DocumentLayoutBox.ChildLayoutBoxes.Last;
    int pagesCount = lastSectionLayoutBox.PageNumber;

    Hope this helps.

    Regards,
    Tanya
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Andrew
    Andrew avatar
    13 posts
    Member since:
    Feb 2015

    Posted 11 Jun 2015 in reply to Tanya Link to this post

    Thanks for the reply, it was very helpful.

     

    I've just found a new way of doing this though from searching for the word count.  For reference I've linked the thread below.

     

    http://www.telerik.com/forums/word-counts-with-radrichtextbox

Back to Top