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

How to customise radDocument

1 Answer 157 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Ananthan
Top achievements
Rank 1
Ananthan asked on 15 Apr 2013, 04:42 PM
Hi,
I had created rad blank document
this.NotePadTextBox.Document = new RadDocument();
Now i want to set properties like
  • Height & Width
  • LineSpacing
  • LineSpacingType
    • AtLeast - the space between the lines should equal or greater than the value of the LineSpacing property.
    • Auto - the space between the lines is determined automatically.
    • Exact - the space between the lines should equal to the value of the LineSpacing property.
  • PageViewMargin -
  • ParagraphDefaultSpacingAfter 
  • ParagraphDefaultSpacingBefore
  • SectionDefaultPageMargin -
  • Font
I know two of them this.NotePadTextBox.Document.LayoutMode = DocumentLayoutMode.Paged;
            this.NotePadTextBox.Document.SectionDefaultPageMargin = new System.Windows.Forms.Padding(100);
But i don't know how to set rest of them,it is not specified in help file.
Also i want to set default font for newly created document

1 Answer, 1 is accepted

Sort by
0
Accepted
Svett
Telerik team
answered on 18 Apr 2013, 11:20 AM
Hello Ananthan,

You should use the following code snippet to achieve that:
RadDocument doc = this.radRichTextBox1.Document;
doc.PageViewMargin = new System.Drawing.SizeF(10, 10);
doc.SectionDefaultPageMargin = new System.Windows.Forms.Padding(10);
doc.ParagraphDefaultSpacingAfter = 10;
doc.ParagraphDefaultSpacingBefore = 10;
doc.LineSpacing = 10;
doc.LineSpacingType = LineSpacingType.AtLeast;
 
this.radRichTextBox1.ChangeFontFamily("Verdana");
this.radRichTextBox1.ChangeFontSize(32);

I hope this helps.

All the best,
Svett
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Ananthan
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or