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

Document is being clipped on right

1 Answer 41 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 17 Jan 2012, 10:43 PM
(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: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.Measure(RadDocument.MAX_DOCUMENT_SIZE);
            //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);

            this.editor.Document.UpdateLayout();
        }

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

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 18 Jan 2012, 09:50 AM
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" />


Regards,
Boby
the Telerik team

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

Tags
RichTextBox
Asked by
Edward
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or