Can't change the PageLayoutSetting

2 posts, 0 answers
  1. Andrea Ferrari
    Andrea Ferrari avatar
    9 posts
    Member since:
    Apr 2010

    Posted 28 May 2010 Link to this post

    I need to show some formatted pages on a Book. My customer have seen the Book component and he says: "Wonderful", so now I've to do it.
    I've starder creating an Editor (of course my customer wanto to edit/modify the pages) using the RichTextBox wich load and save the pages on the customers database.
    One day is gone, but the result is fine.

    Now I've to create the Book on a page with dynamic width and hight, so I created a UserControl with a RichTextBox inside, without setting the Height and Width, but setting the Margin.

    And now???
    I've tryied to change the dimension of the page dynamically with the following method when the RichTextBox is loaded:

        private void editor_Loaded(object sender, RoutedEventArgs e)  
          RadRichTextBox tb = sender as RadRichTextBox;  
          tb.Document.PageLayoutSettings.Height = controlSize.Height - defaultMargin.Top - defaultMargin.Bottom;  
          tb.Document.PageLayoutSettings.Width = controlSize.Width - defaultMargin.Left - defaultMargin.Right; ;  
    But, I don't know how to change the left and top margin of the page. Where are the left, top, bottom and right property of the RichTextBox Page?

    Thanks a lot and Regards.
    Andrea Ferrari
  2. Mike
    Mike avatar
    640 posts

    Posted 31 May 2010 Link to this post

    Hello Andrea Ferrari,

    To change the default PageMargins of a document you can use the property RadDocument.SectionDefaultPageMargin. Note that when a document in stored in Xaml format it contains information about PageMargins. In this case, after loading document you may need to set the page margin of the first Section in the document:

    Kind regards,
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
Back to Top