How to customise radDocument

2 posts, 1 answers
  1. Ananthan
    Ananthan avatar
    8 posts
    Member since:
    Mar 2013

    Posted 15 Apr 2013 Link to this post

    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
  2. Answer
    Svett avatar
    728 posts

    Posted 18 Apr 2013 Link to this post

    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;

    I hope this helps.

    All the best,
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  3. DevCraft R3 2016 release webinar banner
Back to Top