officefileapi-devexpress-dot-xtrarichedit-dot-richeditview-8b794ab7.md
Gets or sets whether line numbers can be displayed in the view.
Namespace : DevExpress.XtraRichEdit
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
[DefaultValue(false)]
public virtual bool AllowDisplayLineNumbers { get; set; }
<DefaultValue(False)>
Public Overridable Property AllowDisplayLineNumbers As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true to show line numbers if they are enabled; otherwise, false.
|
To enable line numbering, set the SectionLineNumbering.CountBy value for the document section to a positive integer other than zero.
In SimpleView and DraftView views line numbers are outside the default visible area, so you have to provide a space to display them by setting the left padding to a higher value (use the SimpleView.Padding or the DraftView.Padding property, respectively).
Note
In Print Layout View use the PrintLayoutView.AllowDisplayLineNumbers property.
The following code snippets (auto-collected from DevExpress Examples) contain references to the AllowDisplayLineNumbers property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-enable-line-numbering-and-count-document-rows/CS/LineNumberingExample/Form1.cs#L35
this.richEditControl1.Views.DraftView.Padding = new PortablePadding(60, 4, 4, 0);
richEditControl1.Views.SimpleView.AllowDisplayLineNumbers = true;
richEditControl1.Views.DraftView.AllowDisplayLineNumbers = true;
winforms-richeditcontrol-common-api/CS/RichEditAPISample/CodeExamples/RichEditControlActions.cs#L616
richEditControl.Views.SimpleView.Padding = new DevExpress.Portable.PortablePadding(60, 4, 4, 0);
richEditControl.Views.SimpleView.AllowDisplayLineNumbers = true;
richEditControl.ActiveViewType = RichEditViewType.Simple;
winforms-richedit-enable-line-numbering-and-count-document-rows/VB/LineNumberingExample/Form1.vb#L31
richEditControl1.Views.DraftView.Padding = New PortablePadding(60, 4, 4, 0)
richEditControl1.Views.SimpleView.AllowDisplayLineNumbers = True
richEditControl1.Views.DraftView.AllowDisplayLineNumbers = True
winforms-richeditcontrol-common-api/VB/RichEditAPISample/CodeExamples/RichEditControlActions.vb#L632
richEditControl.Views.SimpleView.Padding = New DevExpress.Portable.PortablePadding(60, 4, 4, 0)
richEditControl.Views.SimpleView.AllowDisplayLineNumbers = True
richEditControl.ActiveViewType = RichEditViewType.Simple
See Also