Back to Devexpress

NumberingList Interface

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-d352da7c.md

latest4.6 KB
Original Source

NumberingList Interface

A numbering definition instance referenced by paragraphs in a document that comprises a numbering list.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
[ComVisible(true)]
public interface NumberingList :
    NumberingListBase
vb
<ComVisible(True)>
Public Interface NumberingList
    Inherits NumberingListBase

The following members return NumberingList objects:

Remarks

The NumberingList object is based on an abstract numbering definition which can be accessed via the NumberingList.AbstractNumberingList property.

Document paragraphs are included into a numbering list by using the ParagraphCollection.AddParagraphsToList method.

The list to which a specific paragraph belongs can be obtained via the Paragraph.ListIndex property.

For an example of use see the AbstractNumberingList article.

View Example

csharp
Document document = server.Document;

document.BeginUpdate();

//Create a new pattern object
AbstractNumberingList abstractListNumberingRoman = document.AbstractNumberingLists.Add();

//Specify the list's type
abstractListNumberingRoman.NumberingType = NumberingType.Simple;

//Define the first level's properties
ListLevel level = abstractListNumberingRoman.Levels[0];
level.ParagraphProperties.LeftIndent = 150;

// Align list with the surrounding text
level.ParagraphProperties.FirstLineIndentType = ParagraphFirstLineIndent.Hanging;
level.ParagraphProperties.FirstLineIndent = 75;
level.Start = 1;

//Specify the roman format
level.NumberingFormat = NumberingFormat.LowerRoman;
level.DisplayFormatString = "{0}.";

//Create a new list based on the specific pattern
NumberingList numberingList = document.NumberingLists.Add(0);

document.EndUpdate();

document.BeginUpdate();
ParagraphCollection paragraphs = document.Paragraphs;
//Add paragraphs to the list
paragraphs.AddParagraphsToList(document.Range, numberingList, 0);
document.EndUpdate();
vb
document.BeginUpdate()

'Create a new pattern object
Dim abstractListNumberingRoman As AbstractNumberingList = document.AbstractNumberingLists.Add()

'Specify the list's type
abstractListNumberingRoman.NumberingType = NumberingType.Simple

'Define the first level's properties
Dim level As ListLevel = abstractListNumberingRoman.Levels(0)
level.ParagraphProperties.LeftIndent = 150

' Align list with the surrounding text
level.ParagraphProperties.FirstLineIndentType = ParagraphFirstLineIndent.Hanging
level.ParagraphProperties.FirstLineIndent = 75

level.Start = 1
level.NumberingFormat = NumberingFormat.LowerRoman
level.DisplayFormatString = "{0}."

'Create a new list based on the specific pattern
Dim numberingList As NumberingList = document.NumberingLists.Add(0)
document.EndUpdate()

document.BeginUpdate()
Dim paragraphs As ParagraphCollection = document.Paragraphs

'Add paragraphs to the list
paragraphs.AddParagraphsToList(document.Range, numberingList, 0)
document.EndUpdate()

See Also

NumberingList Members

AbstractNumberingList

ListLevel

ListLevelProperties

DevExpress.XtraRichEdit.API.Native Namespace