officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section-e4682046.md
Provides access to the object containing line numbering parameters for the current section.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
SectionLineNumbering LineNumbering { get; }
ReadOnly Property LineNumbering As SectionLineNumbering
| Type | Description |
|---|---|
| SectionLineNumbering |
A SectionLineNumbering class instance representing parameters specific to line numbering.
|
Set the RichEditView.AllowDisplayLineNumbers option for the current view to true and specify the SectionLineNumbering.CountBy property to any value other than 0 to enable Line Numbering.
In SimpleView and DraftView view line numbers are outside the default visible area, so you have to provide a space to display them. Use the SimpleView.Padding or the DraftView.Padding property to set the left padding to a higher value.
The line numbering font face and font color are specified by the Line Number character style.
richEditControl.LoadDocument("Documents\\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx);
richEditControl.Views.SimpleView.Padding = new DevExpress.Portable.PortablePadding(60, 4, 4, 0);
richEditControl.Views.SimpleView.AllowDisplayLineNumbers = true;
richEditControl.ActiveViewType = RichEditViewType.Simple;
richEditControl.Document.Sections[0].LineNumbering.CountBy = 1;
richEditControl.Document.CharacterStyles["Line Number"].ForeColor = Color.LightGray;
richEditControl.Document.CharacterStyles["Line Number"].Bold = true;
richEditControl.LoadDocument("Documents\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx)
richEditControl.Views.SimpleView.Padding = New DevExpress.Portable.PortablePadding(60, 4, 4, 0)
richEditControl.Views.SimpleView.AllowDisplayLineNumbers = True
richEditControl.ActiveViewType = RichEditViewType.Simple
richEditControl.Document.Sections(0).LineNumbering.CountBy = 1
richEditControl.Document.CharacterStyles("Line Number").ForeColor = System.Drawing.Color.LightGray
richEditControl.Document.CharacterStyles("Line Number").Bold = True
See Also