Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SectionLineNumbering Interface

Defines line numbers in the left margin or to the left of each column in the document’s Section.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

#Declaration

[ComVisible(true)]
public interface SectionLineNumbering

The following members return SectionLineNumbering objects:

#Remarks

The SectionLineNumbering interface is accessible via the Section.LineNumbering property of the document’s section.

By default, line numbering is suppressed. To switch line numbering on, set the AllowDisplayLineNumbers property of the required view to true and also set the SectionLineNumbering.CountBy property to any non-zero positive integer value.

#Example

View Example: Word Processing Document API – How to Process Word Documents in Code

using DevExpress.XtraRichEdit.API.Native;
using DevExpress.XtraRichEdit;
using DevExpress.Office;

static void LineNumbering(RichEditDocumentServer wordProcessor) {

    // Load a document from a file.
    wordProcessor.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);

    // Access a document.
    Document document = wordProcessor.Document;

    // Specify the document’s measure units.
    document.Unit = DevExpress.Office.DocumentUnit.Inch;

    // Access the first document section.
    Section sec = document.Sections[0];

    // Specify line numbering parameters for the section.
    sec.LineNumbering.CountBy = 2;
    sec.LineNumbering.Start = 1;
    sec.LineNumbering.Distance = 0.25f;
    sec.LineNumbering.RestartType = LineNumberingRestart.NewSection;
}
See Also