Document is being clipped on right

2 posts, 0 answers
  1. Edward
    Edward avatar
    6 posts
    Member since:
    Jan 2012

    Posted 17 Jan 2012 Link to this post

    (Hi, new to telerik radcontrols...  perhaps someone can forward a quick pointer my way...)
    I am loading a raddocument from docx by import:
    but it is clipped on the right side.  Only 6.5 inches of the document is being shown (not 8.5 inches).

            <telerik:RadRichTextBoxRibbonUI Visibility="Collapsed" Grid.Column="1" ApplicationButtonImageSource="/RichTextBox;component/Images/RichTextBox/MSOffice/AppIcon-telerik.png" DataContext="{Binding Path=Commands, ElementName=editor}" Name="radRichTextBoxRibbonUI">
            <telerik:RadRichTextBox Visibility="Collapsed" Grid.Row="1" x:Name="editor" Margin="24 24 0 0" AllowDrop="True" Drop="editor_Drop" ShowComments="True" IsSpellCheckingEnabled="False" LayoutMode="Flow" />
            <telerik:DocumentRuler x:Name="ruler" AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}" Grid.Row="1" />
            <telerik:RadRichTextBoxStatusBar Grid.Row="2" AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}"/>

      public void ImportDocument(byte[] data)
                this.editor.Document = GetDocumentFromDocx(data);
                //this.editor.Document.Arrange(new RectangleF(PointF.Empty, this.editor.Document.DesiredSize));
                this.editor.Document.LayoutMode = DocumentLayoutMode.Paged;

                //this.editor.Document.DefaultPageLayoutSettings.Width = 320 / 0.7F;
                //this.editor.Document.DefaultPageLayoutSettings.Height = 390 / 0.7F;
                //this.editor.Document.SectionDefaultPageMargin = new Padding(55);
                //this.editor.Document.Sections.First.PageMargin = new Padding(55);


            private static RadDocument GetDocumentFromDocx(byte[] docx)
                RadDocument result;
                if (docx == null || docx.Length == 0)
                    result = new RadDocument();
                    IDocumentFormatProvider provider = new DocxFormatProvider();
                    result = provider.Import(docx);
                return result;

  2. Boby
    Boby avatar
    685 posts

    Posted 18 Jan 2012 Link to this post

    Hello Edward,
    There is place reserved for comments on the right. You can hide it by setting ShowComments property to false:
    <telerik:RadRichTextBox Visibility="Collapsed" Grid.Row="1" x:Name="editor" Margin="24 24 0 0" AllowDrop="True" Drop="editor_Drop" ShowComments="False" IsSpellCheckingEnabled="False" LayoutMode="Flow" />

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top